[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090708104701.GA31419@infradead.org>
Date: Wed, 8 Jul 2009 06:47:01 -0400
From: Christoph Hellwig <hch@...radead.org>
To: Nick Piggin <npiggin@...e.de>
Cc: Christoph Hellwig <hch@...radead.org>,
linux-fsdevel@...r.kernel.org, Jan Kara <jack@...e.cz>,
LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [rfc][patch 3/4] fs: new truncate sequence
On Wed, Jul 08, 2009 at 08:32:25AM +0200, Nick Piggin wrote:
> Thanks for the patch, I think I will fold it in to the series. I
> think we probably do need to call simple_setsize in inode_setattr
> though (unless you propose to eventually convert every filesystem
> to define a .setattr). This would also require eg. your ext2
> conversion to strip ATTR_SIZE before passing through to inode_setattr.
Yes, we should eventually make .setattr mandatory. Doing a default
action when a method lacks tends to cause more issues than it solves.
I'm happy to help in doing that part of the conversion (and also other
bits)
> > int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
> > {
> > struct inode *inode = dentry->d_inode;
> > int error;
> >
> > + if (iattr->ia_valid & ATTR_SIZE) {
> > + error = ext2_setsize(inode, iattr->ia_size);
> > + if (error)
> > + return error;
> > + }
> > +
> > error = inode_change_ok(inode, iattr);
> > if (error)
> > return error;
>
> Probably want to call inode_change_ok first here.
Right now I tried to no reorder anything versus the previous patch.
But yes, we should do all the checks first. Possibly we can even add
a call to inode_newsize_ok to inode_change_ok, but I'd like to defer
that until all conversions are done and we can easily audit it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists