The original old (v2.13) fdisk had sleep(2) beany ideafore re-read ioctl. It
seems overkill, but short sleep is probably a good idea as we call
re-read on sfdisk start and at the end. It's possible that sfdisk is
too fast and the initial re-read is not gone yet.
It would be nice to have something more elegant than sleep, any idea?
Addresses: https://github.com/karelzak/util-linux/issues/557
Signed-off-by: Karel Zak <kzak@redhat.com>
rc = move_partition_data(sf, sf->partno, sf->orig_pa);
if (!rc) {
fdisk_info(sf->cxt, _("\nThe partition table has been altered."));
- if (!sf->notell)
+ if (!sf->notell) {
+ /* Let's wait a little bit. It's possible that our
+ * system is still busy with a previous re-read
+ * ioctl (on sfdisk start) or with another task
+ * related to the write to the device.
+ */
+ xusleep(250000);
fdisk_reread_partition_table(sf->cxt);
+ }
}
}
if (!rc)