]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
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? | |
5 | ||
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... | |
8 | ||
9 | Signed-off-by: Jan Kara <jack@suse.cz> | |
10 | ||
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 | |
15 | @@ -768,6 +768,8 @@ | |
16 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) { | |
17 | if (type != -1 && cnt != type) | |
18 | continue; | |
19 | + if (!sb_has_quota_active(sb, cnt)) | |
20 | + continue; | |
21 | oinfo = sb_dqinfo(sb, cnt)->dqi_priv; | |
22 | status = ocfs2_lock_global_qf(oinfo, 0); | |
23 | if (status < 0) | |
24 | @@ -836,6 +838,8 @@ | |
25 | struct ocfs2_mem_dqinfo *oinfo; | |
26 | ||
27 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) { | |
28 | + if (!sb_has_quota_active(sb, cnt)) | |
29 | + continue; | |
30 | oinfo = sb_dqinfo(sb, cnt)->dqi_priv; | |
31 | status = ocfs2_lock_global_qf(oinfo, 1); | |
32 | if (status < 0) | |
33 | @@ -873,6 +877,8 @@ | |
34 | ||
35 | mlog_entry_void(); | |
36 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) { | |
37 | + if (!sb_has_quota_active(sb, cnt)) | |
38 | + continue; | |
39 | oinfo = sb_dqinfo(sb, cnt)->dqi_priv; | |
40 | status = ocfs2_lock_global_qf(oinfo, 0); | |
41 | if (status < 0) |