From: Nick Piggin <npiggin@suse.de>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
linux-fsdevel@vger.kernel.org
Subject: Re: [patch] fix truncate inode time modification breakage
Date: Wed, 2 Jun 2010 00:32:03 +1000 [thread overview]
Message-ID: <20100601143203.GX9453@laptop> (raw)
In-Reply-To: <4C0514BD.9070101@panasas.com>
On Tue, Jun 01, 2010 at 05:10:05PM +0300, Boaz Harrosh wrote:
> On 06/01/2010 04:39 PM, Nick Piggin wrote:
> > It appears that I've broken inode time modifications on tmpfs/ext2.
> > While ftruncate always updates these attributes, truncate must not
> > unless size is changed. I hadn't actually understood that until
> > Christoph told me.
> >
> > Confusion is increased because other filesystems get this wrong.
> > Those without ->setattr or ->truncate get it wrong by default.
> > Others appear to have problems too.
> >
> > I haven't gone through many yet, but is there any reason not to
> > just do it in the vfs?
> >
> > ---
> > fs/ext2/inode.c | 1 -
> > fs/open.c | 3 +++
> > fs/ramfs/file-nommu.c | 5 -----
> > mm/shmem.c | 5 +++--
> > 4 files changed, 6 insertions(+), 8 deletions(-)
> >
> > Index: linux-2.6/fs/ext2/inode.c
> > ===================================================================
> > --- linux-2.6.orig/fs/ext2/inode.c
> > +++ linux-2.6/fs/ext2/inode.c
> > @@ -1203,7 +1203,6 @@ int ext2_setsize(struct inode *inode, lo
> >
> > __ext2_truncate_blocks(inode, newsize);
> >
> > - inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
>
> OK I was just investigating this. Please forgive my noviceness here:
>
> So i_mtime is modifications time. i_ctime is creation time?
>
> if I do ftrunc() (like dd skip=x) don't I want modification time changed
> but creation time unchanged?
It's change time and modification time. modification time is for data
modification. change time is for data and metadata as far as I know
(with various little historic quirks like truncate/ftruncate).
prev parent reply other threads:[~2010-06-01 14:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 13:39 [patch] fix truncate inode time modification breakage Nick Piggin
2010-06-01 13:48 ` Christoph Hellwig
2010-06-01 13:56 ` Nick Piggin
2010-06-02 19:55 ` [patch v2] " Nick Piggin
2010-06-02 20:08 ` Filesystem setattr/truncate notes and problems Nick Piggin
2010-06-03 7:28 ` Christoph Hellwig
2010-06-03 7:32 ` Christoph Hellwig
2010-06-03 9:50 ` Nick Piggin
2010-06-03 9:18 ` Nick Piggin
2010-06-03 9:26 ` Nick Piggin
2010-06-03 8:18 ` [patch v2] fix truncate inode time modification breakage Miklos Szeredi
2010-06-03 8:40 ` Boaz Harrosh
2010-06-03 9:05 ` Miklos Szeredi
2010-06-03 12:13 ` Boaz Harrosh
2010-06-03 9:14 ` Nick Piggin
2010-06-03 9:28 ` Miklos Szeredi
2010-06-03 10:07 ` Nick Piggin
2010-06-03 10:58 ` Miklos Szeredi
2010-06-03 11:09 ` Christoph Hellwig
2010-06-03 12:01 ` [patch v3] " Nick Piggin
2010-06-03 11:49 ` [patch v2] " Nick Piggin
2010-06-03 12:03 ` Miklos Szeredi
2010-06-01 14:10 ` [patch] " Boaz Harrosh
2010-06-01 14:32 ` Nick Piggin [this message]
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=20100601143203.GX9453@laptop \
--to=npiggin@suse.de \
--cc=bharrosh@panasas.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).