Re: [PATCH against 2.6.14] truncate() or ftruncate shouldn'tchange mtime if size doesn't change.

From: Trond Myklebust
Date: Mon Oct 31 2005 - 19:40:35 EST


On Tue, 2005-11-01 at 09:53 +1100, Neil Brown wrote:
> On Monday October 31, trond.myklebust@xxxxxxxxxx wrote:
> >
> > What we can, however, do is to ensure that truncate() and ftruncate()
> > only set ATTR_SIZE, but ensure that may_open() sets ATTR_MTIME|
> > ATTR_CTIME as well.
>
> Thanks. This makes lots of sense, in that it gives power to the
> filesystem. We should keep the optimisations in placed where the
> filesystem can over-ride them, just as inode_setattr.
>
> So, here is a revised patch.
> Comment?

Just one. Don't most of the inode->i_op->truncate() methods on local
filesystems call mark_inode_dirty()?
If so, then the call at the end of inode_setattr() will be superfluous
for the case where ia_valid==ATTR_SIZE, since vmtruncate() will dirty
the inode for us.

Otherwise, this patch looks great!

Cheers,
Trond

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