Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b268590 authored by Amir Goldstein's avatar Amir Goldstein Committed by Theodore Ts'o
Browse files

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 21f97697 (ext4: remove unnecessary
[cm]time update of quota file), which was merged for 2.6.39-rc3.

Reported-by: default avatarAmir Goldstein <amir73il@users.sf.net>
Signed-off-by: default avatarAmir Goldstein <amir73il@users.sf.net>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 6976a6f2
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -4681,6 +4681,9 @@ static int ext4_quota_off(struct super_block *sb, int type)
	if (test_opt(sb, DELALLOC))
	if (test_opt(sb, DELALLOC))
		sync_filesystem(sb);
		sync_filesystem(sb);


	if (!inode)
		goto out;

	/* Update modification times of quota files when userspace can
	/* Update modification times of quota files when userspace can
	 * start looking at them */
	 * start looking at them */
	handle = ext4_journal_start(inode, 1);
	handle = ext4_journal_start(inode, 1);