linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hooanon05@yahoo.co.jp
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>,
	bugme-daemon@bugzilla.kernel.org,
	lasse-kernelbug-2008@mail.plastictree.net
Subject: Re: [Bugme-new] [Bug 10276] New: directory ctime not updated by rename
Date: Thu, 20 Mar 2008 12:36:41 +0900	[thread overview]
Message-ID: <7732.1205984201@jrobl> (raw)
In-Reply-To: <20080318174608.GH10722@ZenIV.linux.org.uk>


Al Viro:
> The latter; all control over timestamps on directory operations is in
> filesystems.  Which filesystem it is, BTW?  E.g. ext2 has
>         dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
> in ext2_set_link() (and the same in ext2_add_entry()/ext2_delete_entry()),
> so on all paths in ext2_rename() both parents will get ctime and mtime
> updated; so will the object being moved and the object being unlinked
> (explicitly in ext2_rename()).

Is it correct to update the mtime of renaming inode?
When it is a regular file the mtime is not updated, but a directory. I
have been wondering it for a long time.

$ stat -f .
  File: "."
    ID: c39e8aabce296ceb Namelen: 255     Type: ext2/ext3
Block size: 1024       Fundamental block size: 1024
Blocks: Total: 124442     Free: 122443     Available: 116018
Inodes: Total: 32256      Free: 32144
(actually it is ext2)

$ mkdir d1
$ stat d1
  File: `d1'
  Size: 1024      	Blocks: 2          IO Block: 1024   directory
Device: 30ah/778d	Inode: 2017        Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/     jro)   Gid: ( 1000/     jro)
Access: 2008-03-20 12:33:57.000000000 +0900
Modify: 2008-03-20 12:33:57.000000000 +0900
Change: 2008-03-20 12:33:57.000000000 +0900

$ /tmp/rename d1 d2
(simply issues rename systemcall.)

$ stat d2
  File: `d2'
  Size: 1024      	Blocks: 2          IO Block: 1024   directory
Device: 30ah/778d	Inode: 2017        Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/     jro)   Gid: ( 1000/     jro)
Access: 2008-03-20 12:33:57.000000000 +0900
Modify: 2008-03-20 12:34:11.000000000 +0900
Change: 2008-03-20 12:34:11.000000000 +0900
$ 


Junjiro Okajima

      parent reply	other threads:[~2008-03-20  3:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-10276-10286@http.bugzilla.kernel.org/>
2008-03-18 17:00 ` [Bugme-new] [Bug 10276] New: directory ctime not updated by rename Andrew Morton
2008-03-18 17:46   ` Al Viro
2008-03-18 17:53     ` Al Viro
2008-03-18 17:54     ` Andrew Morton
2008-03-20  3:36     ` hooanon05 [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=7732.1205984201@jrobl \
    --to=hooanon05@yahoo.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=hch@lst.de \
    --cc=lasse-kernelbug-2008@mail.plastictree.net \
    --cc=linux-ext4@vger.kernel.org \
    --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).