1 From: Jan Kara <jack@suse.cz>
2 References: fate#302681
3 Subject: ocfs2: Fix oops when only usrquota or grpquota feature is enabled
4 Patch-mainline: 2.6.29?
6 This patch fixes oops when only usrquota or grpquota feature is enabled on the
7 filesystem. We should not look at quota info header when it does not exist...
9 Signed-off-by: Jan Kara <jack@suse.cz>
11 Index: linux-2.6.27/fs/ocfs2/quota_global.c
12 ===================================================================
13 --- linux-2.6.27.orig/fs/ocfs2/quota_global.c 2008-11-20 21:11:35.000000000 +0100
14 +++ linux-2.6.27/fs/ocfs2/quota_global.c 2008-11-20 21:45:26.000000000 +0100
16 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
17 if (type != -1 && cnt != type)
19 + if (!sb_has_quota_active(sb, cnt))
21 oinfo = sb_dqinfo(sb, cnt)->dqi_priv;
22 status = ocfs2_lock_global_qf(oinfo, 0);
25 struct ocfs2_mem_dqinfo *oinfo;
27 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
28 + if (!sb_has_quota_active(sb, cnt))
30 oinfo = sb_dqinfo(sb, cnt)->dqi_priv;
31 status = ocfs2_lock_global_qf(oinfo, 1);
36 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
37 + if (!sb_has_quota_active(sb, cnt))
39 oinfo = sb_dqinfo(sb, cnt)->dqi_priv;
40 status = ocfs2_lock_global_qf(oinfo, 0);