* General Question: ctime, mtime, and xattrs
@ 2014-12-05 22:08 Robert White
[not found] ` <CAE5mzvgrdYSNWSWLrnmHMz2fSgPSJV_ocYr_ZSBGPwLWBshH-g@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Robert White @ 2014-12-05 22:08 UTC (permalink / raw)
To: Btrfs BTRFS
So I was reading the wiki on the internal layout. The INODE description
says "st_ctime. Also updated when xattrs change."
Why isn't changing the xattrs a modification (st_mtime) event?
It just seems odd to me...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: General Question: ctime, mtime, and xattrs
[not found] ` <CAE5mzvgrdYSNWSWLrnmHMz2fSgPSJV_ocYr_ZSBGPwLWBshH-g@mail.gmail.com>
@ 2014-12-05 23:28 ` Robert White
2014-12-06 1:39 ` Chris Samuel
2014-12-06 2:35 ` Al Viro
0 siblings, 2 replies; 4+ messages in thread
From: Robert White @ 2014-12-05 23:28 UTC (permalink / raw)
To: cwillu; +Cc: linux-btrfs
Ah...
I've been thinking "ctime" is/was (still) "create time". It seems that
somewhere in the last couple decades it became "change time"; Or that I
picked up that incorrect "create time" idea back in the UNIX Sys V R 3
days and just never had cause to think about it again...
Never mind. /sigh...
What a maroon. 8-)
On 12/05/2014 03:03 PM, cwillu wrote:
> xattrs are commonly used to implement acls, which wouldn't typically be
> considered a content modification.
> On Dec 5, 2014 4:08 PM, "Robert White" <rwhite@pobox.com> wrote:
>
>> So I was reading the wiki on the internal layout. The INODE description
>> says "st_ctime. Also updated when xattrs change."
>>
>> Why isn't changing the xattrs a modification (st_mtime) event?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: General Question: ctime, mtime, and xattrs
2014-12-05 23:28 ` Robert White
@ 2014-12-06 1:39 ` Chris Samuel
2014-12-06 2:35 ` Al Viro
1 sibling, 0 replies; 4+ messages in thread
From: Chris Samuel @ 2014-12-06 1:39 UTC (permalink / raw)
To: linux-btrfs
On Fri, 5 Dec 2014 03:28:58 PM Robert White wrote:
> I've been thinking "ctime" is/was (still) "create time". It seems that
> somewhere in the last couple decades it became "change time"; Or that I
> picked up that incorrect "create time" idea back in the UNIX Sys V R 3
> days and just never had cause to think about it again...
Sadly there's never been a creation time in Linux that you can get with a
standard system call, there was an attempt 4-5 years ago to get xstat merged
that would include creation time from filesystems that support it (like ext4)
but it never went anywhere (for a variety of reasons).
LWN article on the patch set:
https://lwn.net/Articles/394298/
Linus knocking it back:
https://lkml.org/lkml/2010/7/22/249
FreeBSD has:
st_birthtim Time when the inode was created.
No idea when that was added!
All the best,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: General Question: ctime, mtime, and xattrs
2014-12-05 23:28 ` Robert White
2014-12-06 1:39 ` Chris Samuel
@ 2014-12-06 2:35 ` Al Viro
1 sibling, 0 replies; 4+ messages in thread
From: Al Viro @ 2014-12-06 2:35 UTC (permalink / raw)
To: Robert White; +Cc: cwillu, linux-btrfs
On Fri, Dec 05, 2014 at 03:28:58PM -0800, Robert White wrote:
> Ah...
>
> I've been thinking "ctime" is/was (still) "create time". It seems
> that somewhere in the last couple decades it became "change time";
> Or that I picked up that incorrect "create time" idea back in the
> UNIX Sys V R 3 days and just never had cause to think about it
> again...
v7 is the point where the third timestamp has first appeared (v6 has
only two - access and update). And their stat(2) says this:
st_atime is the file was last read. For reasons of efficiency, it is
not set when a directory is searched, although this would be more logi‐
cal. st_mtime is the time the file was last written or created. It is
not set by changes of owner, group, link count, or mode. st_ctime is
set both both by writing and changing the i-node.
FWIW, their /usr/sys/sys/sys4.c has
chmod()
{
register struct inode *ip;
register struct a {
char *fname;
int fmode;
} *uap;
uap = (struct a *)u.u_ap;
if ((ip = owner()) == NULL)
return;
ip->i_mode &= ~07777;
if (u.u_uid)
uap->fmode &= ~ISVTX;
ip->i_mode |= uap->fmode&07777;
ip->i_flag |= ICHG;
if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0)
xrele(ip);
iput(ip);
}
and /usr/sys/sys/iget.c has, in the end of iupdat() (called on the final
iput(), as well as on stat(2) and several other paths), this:
if(ip->i_flag&IACC)
dp->di_atime = *ta;
if(ip->i_flag&IUPD)
dp->di_mtime = *tm;
if(ip->i_flag&ICHG)
dp->di_ctime = time;
ip->i_flag &= ~(IUPD|IACC|ICHG);
(ta and tm are both equal to &time in that call chain). IOW, chmod(2)
definitely sets ctime.
IOW, ctime has never been "create time"; it's "change time" and it had been
that way since its introduction.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-06 2:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05 22:08 General Question: ctime, mtime, and xattrs Robert White
[not found] ` <CAE5mzvgrdYSNWSWLrnmHMz2fSgPSJV_ocYr_ZSBGPwLWBshH-g@mail.gmail.com>
2014-12-05 23:28 ` Robert White
2014-12-06 1:39 ` Chris Samuel
2014-12-06 2:35 ` Al Viro
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).