summaryrefslogtreecommitdiffstats
path: root/fs/quota/dquot.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r--fs/quota/dquot.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index ba827daea5a0..ff21980d0119 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2047,11 +2047,20 @@ int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
2047 struct quota_info *dqopt = sb_dqopt(sb); 2047 struct quota_info *dqopt = sb_dqopt(sb);
2048 int err; 2048 int err;
2049 2049
2050 if (!dqopt->ops[qid->type]->get_next_id) 2050 mutex_lock(&dqopt->dqonoff_mutex);
2051 return -ENOSYS; 2051 if (!sb_has_quota_active(sb, qid->type)) {
2052 err = -ESRCH;
2053 goto out;
2054 }
2055 if (!dqopt->ops[qid->type]->get_next_id) {
2056 err = -ENOSYS;
2057 goto out;
2058 }
2052 mutex_lock(&dqopt->dqio_mutex); 2059 mutex_lock(&dqopt->dqio_mutex);
2053 err = dqopt->ops[qid->type]->get_next_id(sb, qid); 2060 err = dqopt->ops[qid->type]->get_next_id(sb, qid);
2054 mutex_unlock(&dqopt->dqio_mutex); 2061 mutex_unlock(&dqopt->dqio_mutex);
2062out:
2063 mutex_unlock(&dqopt->dqonoff_mutex);
2055 2064
2056 return err; 2065 return err;
2057} 2066}