Commit 192b4702 authored by Badari Pulavarty's avatar Badari Pulavarty Committed by Linus Torvalds

[PATCH] embarrassing 2.5.31 small bug fix for blkdev_reread_part()

Here is a trivial bug fix for blkdev_reread_part() in 2.5.31.
Without this fix,  "fdisk" hangs with following messages:

	Calling ioctl() to re-read partition table.

	WARNING: Re-reading the partition table failed with error 16:
			Device or resource busy.
	The kernel still uses the old table.
	The new table will be used at the next reboot.
parent dd9831ef
...@@ -797,7 +797,7 @@ static int blkdev_reread_part(struct block_device *bdev) ...@@ -797,7 +797,7 @@ static int blkdev_reread_part(struct block_device *bdev)
part = disk->part + minor(dev) - disk->first_minor; part = disk->part + minor(dev) - disk->first_minor;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
if (down_trylock(&bdev->bd_sem)); if (down_trylock(&bdev->bd_sem))
return -EBUSY; return -EBUSY;
if (bdev->bd_part_count) { if (bdev->bd_part_count) {
up(&bdev->bd_sem); up(&bdev->bd_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment