[PATCH] Fix possible oops on quotaoff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Hi!

  Attached one-liner should fix possible Oops on quotaoff - the code
does not expect quotafiles to have any dquots initialized but they
actually could have some in the following scenario:
  turn on one quota type
  write to the file with the other quota type (quota gets initialize)
  turn on the other quota type

  Please apply the fix (it should apply well to any recent kernel)

								Honza

-- 
Jan Kara <[email protected]>
SuSE CR Labs
Remove dquot structures from quota file on quotaon - quota code does not expect them
to be there.

Signed-off-by: Jan Kara <[email protected]>

diff -rupX /home/jack/.kerndiffexclude linux-2.6.11/fs/dquot.c linux-2.6.11-dropfix/fs/dquot.c
--- linux-2.6.11/fs/dquot.c	2005-03-30 13:37:05.000000000 +0200
+++ linux-2.6.11-dropfix/fs/dquot.c	2005-03-31 14:03:45.000000000 +0200
@@ -1444,6 +1444,7 @@ static int vfs_quota_on_inode(struct ino
 	oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE | S_NOQUOTA);
 	inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE;
 	up_write(&dqopt->dqptr_sem);
+	sb->dq_op->drop(inode);
 
 	error = -EIO;
 	dqopt->files[type] = igrab(inode);

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux