• Andrew Morton's avatar
    [PATCH] sync_fs deadlock fix · e101875d
    Andrew Morton authored
    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.
    e101875d
Locking 15.4 KB