• Jan Kara's avatar
    reiserfs: Protect dquot_writeback_dquots() by s_umount semaphore · 1e0e653f
    Jan Kara authored
    dquot_writeback_dquots() expects s_umount semaphore to be held to
    protect it from other concurrent quota operations. reiserfs_sync_fs()
    can call dquot_writeback_dquots() without holding s_umount semaphore
    when called from flush_old_commits().
    
    Fix the problem by grabbing s_umount in flush_old_commits(). However we
    have to be careful and use only trylock since reiserfs_cancel_old_sync()
    can be waiting for flush_old_commits() to complete while holding
    s_umount semaphore. Possible postponing of sync work is not a big deal
    though as that is only an opportunistic flush.
    
    Fixes: 9d1ccbe7Reported-by: default avatarJan Beulich <jbeulich@suse.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    1e0e653f
super.c 69.2 KB