From: Christoph Hellwig <hch@lst.de>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Christoph Hellwig <hch@lst.de>, Andrew Morton <akpm@osdl.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: + switch-ntfs-to-touch_atime.patch added to -mm tree
Date: Tue, 8 Nov 2005 05:43:10 +0100 [thread overview]
Message-ID: <20051108044310.GC8531@lst.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0511072143430.13960@hermes-1.csi.cam.ac.uk>
[ccing -fsdevel now because this is something of interest to the public]
On Mon, Nov 07, 2005 at 09:51:08PM +0000, Anton Altaparmakov wrote:
> What callers are those? I am curious... The SUS/Posix standard requires
> it as I said in previous post (except for the no size change case but
> as I also said in previous post the VFS does that wrong in same way as
> ntfs and I just copied vfs)...
Besides the various ->setattr instaces which are supposed to set ctime if
ATTR_SIZE|ATTR_CTIME are set (which it is for sys_truncate or
sys_ftruncate but possibly not nfsd requests) generic_file_buffered_write()
calls vmtruncate and thus ->truncate without asking for ctime updates.
The point here is to repeat that the nth time is that you are doing
things in ->truncate that you shouldn't do there. Just move your
updates of the base inode to ->setattr, and update ->i_ctime directly
like all the other filesystems do instead of using inode_update_time
which contains an optimization that's only usefull for a codepath like
write where the ctime/mtime update happens very frequently.
Your use of the function is wrong no matter whether it takes a struct
file or struct inode.
> > so just update them directly for those callers.
>
> That is difficult to do as VFS ->truncate() does not allow an error to be
> returned. And the setting must only happen on success for {f,}truncate().
>
> Thus vmtruncate() always returns success even when ->truncate() failed, so
> VFS _cannot_ be compliant with standard unless it is changed so that
> ->truncate() can return error and vmtruncate() passes that upward to
> ->setattr(). Otherwise you have to do the cmtime updates from
> ->truncate() on success and not do them on failure.
so please submit a patch to allow an error return from ->truncate.
next parent reply other threads:[~2005-11-08 4:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200511060035.jA60Zk1U004874@shell0.pdx.osdl.net>
[not found] ` <20051106041321.GC30958@lst.de>
[not found] ` <20051105203531.7b67c2d8.akpm@osdl.org>
[not found] ` <20051107034614.GB16058@lst.de>
[not found] ` <Pine.LNX.4.64.0511071013550.4659@hermes-1.csi.cam.ac.uk>
[not found] ` <20051107115914.GA24006@lst.de>
[not found] ` <Pine.LNX.4.64.0511072143430.13960@hermes-1.csi.cam.ac.uk>
2005-11-08 4:43 ` Christoph Hellwig [this message]
2005-11-08 9:47 ` + switch-ntfs-to-touch_atime.patch added to -mm tree Anton Altaparmakov
2005-11-08 10:59 ` Anton Altaparmakov
2005-11-08 10:41 ` Anton Altaparmakov
2005-11-08 15:17 ` Dave Kleikamp
2005-11-08 15:25 ` Trond Myklebust
2005-11-08 15:58 ` Anton Altaparmakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051108044310.GC8531@lst.de \
--to=hch@lst.de \
--cc=aia21@cam.ac.uk \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.