]> git.neil.brown.name Git - history.git/commitdiff
umount: avoid racy block-size set
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 17 Mar 2005 04:07:27 +0000 (20:07 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 17 Mar 2005 04:07:27 +0000 (20:07 -0800)
Setting the block size back to the original blocksize at umount time
is unnecessary, and can cause buffer errors and infinite loops in
__getblk_slow, and possibly other problems.

Just getting bdev_lock instead causes other issues, namely AB-BA deadlocks
with /proc/meminfo etc. Just drop it, and replace with a "sync_blockdev()"
to cause a flush (which was a side effect of changing the blocksize before).

Debugging and testing by Jeff Mahoney <jeffm@suse.com>

fs/super.c

index c5b48939c9a86b1ceec228471aab3910571e6bcd..3a1b8ca04ba601b37ffa5dadb8f9695272952e39 100644 (file)
@@ -732,7 +732,7 @@ void kill_block_super(struct super_block *sb)
 
        bdev_uevent(bdev, KOBJ_UMOUNT);
        generic_shutdown_super(sb);
-       set_blocksize(bdev, sb->s_old_blocksize);
+       sync_blockdev(bdev);
        close_bdev_excl(bdev);
 }