]> git.neil.brown.name Git - history.git/commit
[PATCH] sync_fs deadlock fix
authorAndrew Morton <akpm@digeo.com>
Sat, 21 Dec 2002 09:06:54 +0000 (01:06 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 21 Dec 2002 09:06:54 +0000 (01:06 -0800)
commite101875d0b0c0a4a3d2b99c017ad1c8e21b3dd7f
tree82176a595ca9bcc42b7c6677b90394f3afe8e85f
parentd8ce4c5f10c4276f01a06462659ac5779e2b693a
[PATCH] sync_fs deadlock fix

Running a `mount -o remount' against ext3 deadlocks if there is heavy
write activity.  It's a sort of AB/BA deadlock caused by calling
log_wait_commit() under lock_super().  The caller holds lock_super()
and is waiting for a commit, but the commit cannot complete because
lock_super() is also used in the block allocator.

The way we fixed this in tha past is to drop the superblock lock inside
ext3.  The way this patch fixes it is to arrange for lock_super() to
not be held around the ->sync_fs() call.

Also: sync_filesystems is on the sys_sync() path and is racy wrt
unmount.  Check sb->s_root after taking sb->s_umount.
Documentation/filesystems/Locking
fs/buffer.c
fs/super.c