OSDN Git Service

reiserfs: Protect dquot_writeback_dquots() by s_umount semaphore
authorJan Kara <jack@suse.cz>
Wed, 5 Apr 2017 12:17:30 +0000 (14:17 +0200)
committerJan Kara <jack@suse.cz>
Wed, 5 Apr 2017 12:24:55 +0000 (14:24 +0200)
commit1e0e653f1136a413a9969e5d0d548ee6499b9763
treea3e413e0affd13b0906dafa495501ee70216106d
parent71b0576bdb862e964a82c73327cdd1a249c53e67
reiserfs: Protect dquot_writeback_dquots() by s_umount semaphore

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: 9d1ccbe70e0b14545caad12dc73adb3605447df0
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/reiserfs/super.c