OSDN Git Service
linux: add wait time and retries to kernel partition reread
Occasionally when using parted with newer GNU/Linux kernels (2.6.31)
and udev (145), the kernel would fail to reread the partition table.
This could lead to problems with subsequent actions such as formatting
the partition.
Basically this patch increases the retry_count, and adds one sleep(1)
function call prior to the the last few ioctl() calls.
This patch might not be a perfect solution to this problem of "failure
to inform kernel of partition changes", but it does significantly
reduce the likelihood of encountering the problem.
Details on the testing results and procedures used can be found at
the following link:
https://bugzilla.gnome.org/show_bug.cgi?id=604298#c9
* libparted/arch/linux.c (_kernel_reread_part_table): Sleep for a
full second if retry_count makes it down to "3". Start it at 9
rather than at 5.
* NEWS (Bug fixes):