NFS & quota

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Tue, 25 May 1999 13:16:45 +0200


--fL5xGRrasGEqWYE3
Content-Type: text/plain; charset=us-ascii

Hello.

I've done small 2-line patch fixing problem with quotas and knfsd being that file was truncated without
announcing quota. I'm not very familiar with knfsd and so I'm not sure I've done it the *right* way.
I just looked at some other places and then did the same (BTW I find the way knfsd is dealing with
quotas as unlucky - DQUOT_INIT and after operation a DQUOT_DROP... I'll have to think some time
if there aren't any races. When fixing quota code I was supposing that DQUOT_DROP is called only in
special cases - ie. inode is unhashed and so on...). Can some NFS familiar man confirm my patch so I can
submit it to Linus?

Honza.

--fL5xGRrasGEqWYE3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="nfsd-fix.diff"

--- linux/fs/nfsd/vfs.c Mon Apr 12 19:03:45 1999
+++ linux/fs/nfsd/vfs.c Sun May 23 22:13:59 1999
@@ -252,9 +252,11 @@
if (err)
goto out_nfserr;
/* N.B. Should we update the inode cache here? */
+ DQUOT_INIT(inode);
inode->i_size = iap->ia_size;
if (inode->i_op && inode->i_op->truncate)
inode->i_op->truncate(inode);
+ DQUOT_DROP(inode);
mark_inode_dirty(inode);
put_write_access(inode);
iap->ia_valid &= ~ATTR_SIZE;

--fL5xGRrasGEqWYE3--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/