On Mon, Jul 11, 2011 at 2:16 PM, Rich Felker <[email protected]> wrote:
>> I know that linux sync() is documented as not returning until the buffers
>> have been flushed but I think something is delaying them, possibly in the
>> USB stack.
>
> In my opinion the patch is unacceptable as-is. Any sleeps need to be
> optional and off-by-default, and at least someone should investigate
> the time actually needed. Or it could just loop retrying until it's no
> longer busy. This would be much more robust.

The BLKRRPART ioctl can return EBUSY forever if somebody still has a
partition on that disk open.  Example:

# sleep 10000 < /dev/sda1 &
[1] 588
# fdisk /dev/sda

The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses
old table: Device or resource busy
#
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to