summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2011-05-16 09:59:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-03 12:42:43 -0700
commit950b809e6c27e81d63010ed807605dd50047567e (patch)
treebb37ad69fb1377e6e5c6beb57f68c4a74ddd84af
parenta1083b5db47a007efca12466a6520db1d65de09d (diff)
downloadlwn-950b809e6c27e81d63010ed807605dd50047567e.tar.gz
lwn-950b809e6c27e81d63010ed807605dd50047567e.zip
ext4: fix oops in ext4_quota_off()
commit 0b26859027ce0005ef89520af20351360e51ad76 upstream. 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> Cc: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 e28c0f272c7b..e6ea384eb972 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4635,6 +4635,9 @@ static int ext4_quota_off(struct super_block *sb, int type)
if (test_opt(sb, DELALLOC))
sync_filesystem(sb);
+ if (!inode)
+ goto out;
+
/* Update modification times of quota files when userspace can
* start looking at them */
handle = ext4_journal_start(inode, 1);