]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] embarrassing 2.5.31 small bug fix for blkdev_reread_part()
authorBadari Pulavarty <pbadari@us.ibm.com>
Tue, 13 Aug 2002 07:29:36 +0000 (00:29 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 13 Aug 2002 07:29:36 +0000 (00:29 -0700)
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.

fs/block_dev.c

index 411b315cef838790e6891f6a4ede78153f5f0d49..7aa40fbcdc5bd545dac18e4f97786350197fe0f8 100644 (file)
@@ -797,7 +797,7 @@ static int blkdev_reread_part(struct block_device *bdev)
        part = disk->part + minor(dev) - disk->first_minor;
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
-       if (down_trylock(&bdev->bd_sem));
+       if (down_trylock(&bdev->bd_sem))
                return -EBUSY;
        if (bdev->bd_part_count) {
                up(&bdev->bd_sem);