Skip to content

Commit

Permalink
quota: Remove dqonoff_mutex from dquot_scan_active()
Browse files Browse the repository at this point in the history
All callers of dquot_scan_active() now hold s_umount so we can rely on
that lock to protect us against quota state changes.

Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Jan Kara committed Nov 30, 2016
1 parent 2a64f80 commit ee1ac54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/quota/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ int dquot_scan_active(struct super_block *sb,
struct dquot *dquot, *old_dquot = NULL;
int ret = 0;

mutex_lock(&sb_dqopt(sb)->dqonoff_mutex);
WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));

spin_lock(&dq_list_lock);
list_for_each_entry(dquot, &inuse_list, dq_inuse) {
if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
Expand Down Expand Up @@ -603,7 +604,6 @@ int dquot_scan_active(struct super_block *sb,
spin_unlock(&dq_list_lock);
out:
dqput(old_dquot);
mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
return ret;
}
EXPORT_SYMBOL(dquot_scan_active);
Expand Down

0 comments on commit ee1ac54

Please sign in to comment.