Skip to contentSkip to conversation

XFS and atime update strangeness

DISCUSSION Michael Weissenbacher 3 participants 3 messages Jun 19, 2009 – Jun 23, 2009

lore
Share & tools
lore
#0 lore raw

Hi XFS-List!
As i have been playing around with atime settings recently, i noticed that XFS handles atime updates very differently than other filesystems (at least different than ext2/3/4 and reiserfs). In fact it does not record atime changes permanently, it seems that atimes are only stored in the inode cache. I was testing this on a Gentoo Box with kernel 2.6.28-gentoo-r5 and 2.6.30 Vanilla.

How to reproduce?

invincible usr # ls -lu portage/header.txt -rw-r--r-- 1 root root 121 2009-06-18 22:06 portage/header.txt invincible usr # date
Fri Jun 19 11:24:53 CEST 2009
invincible usr # cat portage/header.txt > /dev/null invincible usr # ls -lu portage/header.txt -rw-r--r-- 1 root root 121 2009-06-19 11:24 portage/header.txt invincible usr # umount portage && mount portage invincible usr # ls -lu portage/header.txt -rw-r--r-- 1 root root 121 2009-06-18 22:06 portage/header.txt

So after umount && mount the atime instantly went back to the old value. I can also sometimes reproduce it by doing "sync && echo 3 > /proc/sys/vm/drop_caches". If i wait for a day the atime also reverts back. Rebooting the machine has the same effect.

I haven't found anything in the official documentation stating this. The only reference i found was a while back in the mailing list:
http://oss.sgi.com/archives/xfs/2007-10/msg00171.html

I think there should be at least some information about this behavior in the official docs and the FAQ. IMO This feature/bug of XFS also collides with the recent change to make relatime the default in kernel 2.6.30. Is there any way to enable permanent atime updates in case someone wants them?

Michael

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 17 lines · Michael Weissenbacher

Hi XFS-List!
As i have been playing around with atime settings recently, i noticed that XFS handles atime updates very differently than other filesystems (at least different than ext2/3/4 and reiserfs). In fact it does not record atime changes permanently, it seems that atimes are only stored in the inode cache. I was testing this on a Gentoo Box with kernel 2.6.28-gentoo-r5 and 2.6.30 Vanilla.

How to reproduce?

invincible usr # ls -lu portage/header.txt -rw-r--r-- 1 root root 121 2009-06-18 22:06 portage/header.txt invincible usr # date
Fri Jun 19 11:24:53 CEST 2009
invincible usr # cat portage/header.txt > /dev/null invincible usr # ls -lu portage/header.txt -rw-r--r-- 1 root root 121 2009-06-19 11:24 portage/header.txt invincible usr # umount portage && mount portage invincible usr # ls -lu portage/header.txt -rw-r--r-- 1 root root 121 2009-06-18 22:06 portage/header.txt

Quoted 1 line

So after umount && mount the atime instantly went back to the old value. I can also sometimes reproduce it by doing "sync && echo 3 > /proc/sys/vm/drop_caches". If i wait for a day the atime also reverts back. Rebooting the machine has the same effect.

Right. All this says that atime is updated in the incore inode, but never makes it to disk.
Agree, it's easily reproducible in all latest releases.

Quoted 1 line

I haven't found anything in the official documentation stating this.

That's definitely not a feature to be documented. It has to be fixed.

Quoted 2 lines

The only reference i found was a while back in the mailing list:
http://oss.sgi.com/archives/xfs/2007-10/msg00171.html

And again a year later

http://oss.sgi.com/archives/xfs/2008-10/msg02064.html

Quoted 1 line

I think there should be at least some information about this behavior in the official docs and the FAQ. IMO This feature/bug

bug :)

Quoted 1 line

of XFS also collides with the recent change to make relatime the default in kernel 2.6.30.

If we properly sync the xfs inode to disk, whenever linux inode is dirtied with updated atime, it will work exactly as in VFS (whatever you see before remount), i.e. as relatime.

For this we need the patch suggested by Dave Chinner:

http://oss.sgi.com/archives/xfs/2008-10/msg02102.html

Quoted 1 line

Is there any way to enable permanent atime updates in case someone wants them?

That's another good request I'd like to address as well. The above mentioned patch just makes it behave as relatime.

Thanks for bringing this up.

Felix

Quoted 8 lines

Michael

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 7 lines · Felix Blyakher
Quoted 2 lines · Michael Weissenbacher

Is there any way to enable permanent atime updates in case someone wants them?

That's another good request I'd like to address as well. The above mentioned patch just makes it behave as relatime.

Just to have it explictly mentioned a.k.a. just for the record.

strictatime is AWOL.

With current 2.6.30 you just can't have 'atime' because default was changed to 'relatime' and the former default got the new option 'strictatime'(*). But if i want to mount a XFS-filesystem strictatime:
XFS: unknown mount option [strictatime]

*:
According to fs/namespace.c, line 795 and following these 4 atime-related options appear to be allowed:

{ MNT_NOATIME, ",noatime" },
{ MNT_NODIRATIME, ",nodiratime" },
{ MNT_RELATIME, ",relatime" },
{ MNT_STRICTATIME, ",strictatime" },

Bis denn

Signature · 9 lines
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs