aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2016-04-01 12:00:03 -0400
committerTheodore Ts'o <tytso@mit.edu>2016-04-01 12:00:03 -0400
commit8f0e8746b4d57303d84f7b161a201e94fe22638f (patch)
tree67526f43bcc7847531e7a8d2ff6fdd34c59543e4
parente84dfbe2bf170c626778079e5b94435b05b8d572 (diff)
ext4: avoid calling dquot_get_next_id() if quota is not enabled
This should be fixed in the quota layer so we can test with the quota mutex held, but for now, we need this to avoid tests from crashing the kernel aborting the regression test suite. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--fs/ext4/super.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 7ebd9f040b16..51a131162c11 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1113,6 +1113,7 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
1113static int ext4_quota_enable(struct super_block *sb, int type, int format_id, 1113static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
1114 unsigned int flags); 1114 unsigned int flags);
1115static int ext4_enable_quotas(struct super_block *sb); 1115static int ext4_enable_quotas(struct super_block *sb);
1116static int ext4_get_next_id(struct super_block *sb, struct kqid *qid);
1116 1117
1117static struct dquot **ext4_get_dquots(struct inode *inode) 1118static struct dquot **ext4_get_dquots(struct inode *inode)
1118{ 1119{
@@ -1129,7 +1130,7 @@ static const struct dquot_operations ext4_quota_operations = {
1129 .alloc_dquot = dquot_alloc, 1130 .alloc_dquot = dquot_alloc,
1130 .destroy_dquot = dquot_destroy, 1131 .destroy_dquot = dquot_destroy,
1131 .get_projid = ext4_get_projid, 1132 .get_projid = ext4_get_projid,
1132 .get_next_id = dquot_get_next_id, 1133 .get_next_id = ext4_get_next_id,
1133}; 1134};
1134 1135
1135static const struct quotactl_ops ext4_qctl_operations = { 1136static const struct quotactl_ops ext4_qctl_operations = {
@@ -5274,6 +5275,17 @@ out:
5274 return len; 5275 return len;
5275} 5276}
5276 5277
5278static int ext4_get_next_id(struct super_block *sb, struct kqid *qid)
5279{
5280 const struct quota_format_ops *ops;
5281
5282 if (!sb_has_quota_loaded(sb, qid->type))
5283 return -ESRCH;
5284 ops = sb_dqopt(sb)->ops[qid->type];
5285 if (!ops || !ops->get_next_id)
5286 return -ENOSYS;
5287 return dquot_get_next_id(sb, qid);
5288}
5277#endif 5289#endif
5278 5290
5279static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags, 5291static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,