Re: [patch] fix truncate inode time modification breakage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux