• Jan Kara's avatar
    ext4: fix deadlock in ext4_remount() and orphan list handling · 32c37730
    Jan Kara authored
    ext4_orphan_add() and ext4_orphan_del() functions lock sb->s_lock with a
    transaction started with ext4_mark_recovery_complete() waits for a transaction
    holding sb->s_lock, thus leading to a possible deadlock.  At the moment we
    call ext4_mark_recovery_complete() from ext4_remount() we have done all the
    work needed for remounting and thus we are safe to drop sb->s_lock before we
    wait for transactions to commit.  Note that at this moment we are still
    guarded by s_umount lock against other remounts/umounts.
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Cc: Eric Sandeen <sandeen@sandeen.net>
    Cc: <linux-ext4@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    32c37730
super.c 79.2 KB