X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=fs%2Fquota%2Fdquot.c;h=ff21980d0119a58aa41c825258e435aa799042c7;hb=30aab1897b9592ae40123bc83888d23af06261eb;hp=ba827daea5a0b2a7883327a18a83a43315c9bd2a;hpb=ed7d6bc23b6dd8f5272431ce930c84d1e537be49;p=cascardo%2Flinux.git 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) struct quota_info *dqopt = sb_dqopt(sb); int err; - if (!dqopt->ops[qid->type]->get_next_id) - return -ENOSYS; + mutex_lock(&dqopt->dqonoff_mutex); + if (!sb_has_quota_active(sb, qid->type)) { + err = -ESRCH; + goto out; + } + if (!dqopt->ops[qid->type]->get_next_id) { + err = -ENOSYS; + goto out; + } mutex_lock(&dqopt->dqio_mutex); err = dqopt->ops[qid->type]->get_next_id(sb, qid); mutex_unlock(&dqopt->dqio_mutex); +out: + mutex_unlock(&dqopt->dqonoff_mutex); return err; }