Re: 2.2.7 NFS quota error

Juan Antonio Martinez (jantonio@dit.upm.es)
Mon, 24 May 1999 15:26:56 +0200 (CET)


On Mon, 24 May 1999, Jan Kara wrote:

> Date: Mon, 24 May 1999 14:09:01 +0200
> From: Jan Kara <jack@atrey.karlin.mff.cuni.cz>
> To: Juan Antonio Martinez <jantonio@dit.upm.es>
> Cc: linux-kernel@vger.rutgers.edu
> Subject: Re: 2.2.7 NFS quota error
>
> > Problem: NFS client makes open(filename,O_RDWR|O_CREAT|O_TRUNC,mode ) and
> > quota isn't reevaluated correctly when file already exist
[...]
> >
> > 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.
>
Ok, fantastic!! your two-line patch works fine... expecting get it
into next kernel release :-)

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

Thanks a lot. I really needed it

Juan Antonio \|||/
/ _ _ \
\ o o /
=========================o00o===U===o00o======================================
Juan Antonio Martínez Universidad Politécnica de Madrid
email: jantonio@dit.upm.es E.T.S.I Telecomunicación
http://www.dit.upm.es/~jantonio Ciudad Universitaria s/n
Tel: 34-1-5495700 ext 328 Centro de Cálculo
Fax: 34-1-3367333 Madrid, Spain
==============================================================================

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