Skip to contentSkip to conversation

Don't set relatime when noatime is specified

PATCH In review Andi Kleen 2 participants 2 messages Apr 19, 2009 VFS

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Don't set relatime when noatime is specified

Don't set relatime when noatime is specified

Since

commit 0a1c01c9477602ee8b44548a9405b2c1d587b5a2

Author: Matthew Garrett <[email protected]>
Date:   Thu Mar 26 17:53:14 2009 +0000

Make relatime default

when a file system is mounted explicitely with noatime it gets both relatime and noatime set.

This shows up like this in /proc/mounts:

/dev/xxx /yyy ext3 rw,noatime,relatime,errors=continue,data=writeback 0 0

That looks strange. The VFS uses noatime in this case, but both flags are set. So it's more a cosmetic issue, but still better to fix.

---
 fs/namespace.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/namespace.c +3 -2
Index: linux-2.6.30-rc2-ak/fs/namespace.c
===================================================================
@@ -1920,8 +1920,9 @@
 	if (data_page)
 		((char *)data_page)[PAGE_SIZE - 1] = 0;
 
-	/* Default to relatime */
-	mnt_flags |= MNT_RELATIME;
+	/* Default to relatime unless overriden */
+	if (!(flags & MS_NOATIME))
+		mnt_flags |= MNT_RELATIME;
 
 	/* Separate the per-mountpoint flags */
 	if (flags & MS_NOSUID)