Skip to contentSkip to conversation

Fix possible oops on quotaoff

PATCH New Jan Kara 1 participant 1 message Mar 31, 2005 VFS

lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 Fix possible oops on quotaoff

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

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs

Remove dquot structures from quota file on quotaon - quota code does not expect them to be there.

fs/dquot.c +1 -0
diff -rupX /home/jack/.kerndiffexclude linux-2.6.11/fs/dquot.c linux-2.6.11-dropfix/fs/dquot.c
@@ -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);