OSDN Git Service

linux: add wait time and retries to kernel partition reread
authorCurtis Gedak <gedakc@gmail.com>
Mon, 22 Feb 2010 08:13:53 +0000 (09:13 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 22 Feb 2010 08:13:53 +0000 (09:13 +0100)
commit0a21f0b7ed7ff0e536a5c30dfe1910c33d2ca243
tree3ff53ffca17cf5a28473516263c5e63a9f2d7f98
parent66df8b2ce2f596e7c446c08d9874cce5700555fd
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):
NEWS
libparted/arch/linux.c