aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2011-05-16 09:59:13 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-05-16 09:59:13 -0400
commit0b26859027ce0005ef89520af20351360e51ad76 (patch)
treed0d8cec8c1f413c0980b4a66614871bd435ab334 /fs/ext4
parent6976a6f2acde2b0443cd64f1d08af90630e4ce81 (diff)
ext4: fix oops in ext4_quota_off()
If quota is not enabled when ext4_quota_off() is called, we must not dereference quota file inode since it is NULL. Check properly for this. This fixes a bug in commit 21f976975cbe (ext4: remove unnecessary [cm]time update of quota file), which was merged for 2.6.39-rc3. Reported-by: Amir Goldstein <amir73il@users.sf.net> Signed-off-by: Amir Goldstein <amir73il@users.sf.net> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index fc827bb2a69b..268935118251 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4681,6 +4681,9 @@ static int ext4_quota_off(struct super_block *sb, int type)
4681 if (test_opt(sb, DELALLOC)) 4681 if (test_opt(sb, DELALLOC))
4682 sync_filesystem(sb); 4682 sync_filesystem(sb);
4683 4683
4684 if (!inode)
4685 goto out;
4686
4684 /* Update modification times of quota files when userspace can 4687 /* Update modification times of quota files when userspace can
4685 * start looking at them */ 4688 * start looking at them */
4686 handle = ext4_journal_start(inode, 1); 4689 handle = ext4_journal_start(inode, 1);