diff options
Diffstat (limited to 'fs/quota/quota.c')
-rw-r--r-- | fs/quota/quota.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index ff3f0b3cfdb3..75621649dbd7 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
@@ -79,13 +79,13 @@ static int quota_getfmt(struct super_block *sb, int type, void __user *addr) | |||
79 | { | 79 | { |
80 | __u32 fmt; | 80 | __u32 fmt; |
81 | 81 | ||
82 | down_read(&sb_dqopt(sb)->dqptr_sem); | 82 | mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); |
83 | if (!sb_has_quota_active(sb, type)) { | 83 | if (!sb_has_quota_active(sb, type)) { |
84 | up_read(&sb_dqopt(sb)->dqptr_sem); | 84 | mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); |
85 | return -ESRCH; | 85 | return -ESRCH; |
86 | } | 86 | } |
87 | fmt = sb_dqopt(sb)->info[type].dqi_format->qf_fmt_id; | 87 | fmt = sb_dqopt(sb)->info[type].dqi_format->qf_fmt_id; |
88 | up_read(&sb_dqopt(sb)->dqptr_sem); | 88 | mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); |
89 | if (copy_to_user(addr, &fmt, sizeof(fmt))) | 89 | if (copy_to_user(addr, &fmt, sizeof(fmt))) |
90 | return -EFAULT; | 90 | return -EFAULT; |
91 | return 0; | 91 | return 0; |