summaryrefslogtreecommitdiff
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-04 23:18:27 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-04 23:18:27 +0300
commite865f4965ff636cf18c9bed52dba44899ff63594 (patch)
tree5a2f7b3ef069ffd3a3129871d8be0fbbd8388e78 /fs/ocfs2
parentc7e82c648598b6fc8aa65b4bb99b55b6dd23faad (diff)
parent8f9e8f5fcc059a3cba87ce837c88316797ef3645 (diff)
downloadlinux-e865f4965ff636cf18c9bed52dba44899ff63594.tar.xz
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
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/quota_global.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index 3892f3c079ca..ab6a6cdcf91c 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -867,6 +867,10 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
int status = 0;
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);
if (status < 0)
goto out;
@@ -878,8 +882,11 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
out_global:
ocfs2_unlock_global_qf(info, 0);
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);
return status;
}