Re: 2.2.7 NFS quota error

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Mon, 24 May 1999 14:09:01 +0200


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

<snip>
> [jamc@l034 jamc]$ dd if=/dev/zero of=kk bs=1024 count=14000
> 14000+0 records in
> 14000+0 records out
> ( still in quota but next to limit )
>
> ( Now try to get some data into SAME file.... and crash )
>
> [jamc@l034 jamc]$ dd if=/dev/zero of=kk bs=1024 count=1000
> dd: kk: Disc quota exceeded
> 421+0 records in
> 420+0 records out
> [jamc@l034 jamc]$ quota
> Disk quotas for user jamc (uid 16062):
> Filesystem blocks quota limit grace files quota limit grace
> cuentas:/users/cuentas
> 15000* 11250 15000 7days 73 0 0
> ( whooops !!! what happened )
>
> [jamc@l034 jamc]$ du -s .
> 944 .
> ( the real size: 521 original + 421 of "kk" file... but quota talks about the
> sum of old an new "kk" file..... )
>
> I've not been able to reproduce this error when using local ( non-NFS )
> filesystem in the server so seems to be NFS-related error
I've been looking into the NFSD code. Now I can imagine this can happen ;-)... I've
found one place on which NFSD does truncate and the inode isn't DQUOT_INIT (I don't
say it can't be, I just don't see it nearby :-)) which can result exactly in described
behaviour. Maybe you can try this 2 line patch and see whether it changes anything.

Honza.

--azLHFNyN32YCQGCU
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;

--azLHFNyN32YCQGCU--

-
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/