mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-05 14:14:54 +00:00
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull quota fixes from Jan Kara: "Fixes for oopses when the new quotactl gets used with quotas disabled" * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ocfs2: Fix Q_GETNEXTQUOTA for filesystem without quotas quota: Handle Q_GETNEXTQUOTA when quota is disabled
This commit is contained in:
commit
e865f4965f
2 changed files with 20 additions and 4 deletions
|
@ -867,6 +867,10 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
|
trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
|
||||||
|
if (!sb_has_quota_loaded(sb, type)) {
|
||||||
|
status = -ESRCH;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
status = ocfs2_lock_global_qf(info, 0);
|
status = ocfs2_lock_global_qf(info, 0);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -878,8 +882,11 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
|
||||||
out_global:
|
out_global:
|
||||||
ocfs2_unlock_global_qf(info, 0);
|
ocfs2_unlock_global_qf(info, 0);
|
||||||
out:
|
out:
|
||||||
/* Avoid logging ENOENT since it just means there isn't next ID */
|
/*
|
||||||
if (status && status != -ENOENT)
|
* Avoid logging ENOENT since it just means there isn't next ID and
|
||||||
|
* ESRCH which means quota isn't enabled for the filesystem.
|
||||||
|
*/
|
||||||
|
if (status && status != -ENOENT && status != -ESRCH)
|
||||||
mlog_errno(status);
|
mlog_errno(status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2047,11 +2047,20 @@ int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
|
||||||
struct quota_info *dqopt = sb_dqopt(sb);
|
struct quota_info *dqopt = sb_dqopt(sb);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (!dqopt->ops[qid->type]->get_next_id)
|
mutex_lock(&dqopt->dqonoff_mutex);
|
||||||
return -ENOSYS;
|
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);
|
mutex_lock(&dqopt->dqio_mutex);
|
||||||
err = dqopt->ops[qid->type]->get_next_id(sb, qid);
|
err = dqopt->ops[qid->type]->get_next_id(sb, qid);
|
||||||
mutex_unlock(&dqopt->dqio_mutex);
|
mutex_unlock(&dqopt->dqio_mutex);
|
||||||
|
out:
|
||||||
|
mutex_unlock(&dqopt->dqonoff_mutex);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue