Skip to content

Commit

Permalink
ext4: fix oops in ext4_quota_off()
Browse files Browse the repository at this point in the history
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 21f9769 (ext4: remove unnecessary
[cm]time update of quota file), which was merged for 2.6.39-rc3.

Reported-by: Amir Goldstein <[email protected]>
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
amir73il authored and tytso committed May 16, 2011
1 parent 6976a6f commit 0b26859
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -4681,6 +4681,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);
Expand Down

0 comments on commit 0b26859

Please sign in to comment.