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

Bug#634152: FTBFS on kfreebsd-amd64



Hi Robert,

Robert Millan wrote:

> $ cat ./build-tree/kfreebsd-amd64-libc/libio/tst-atime.out
> atime has not changed
>
> Note: Following suggestion by Petr I retested on another filesystem.
> It seems that this bug only appears when /tmp is mounted on ZFS.

Ah, sounds like /tmp was mounted with the noatime flag.  How about
something like this (untested)?

2011-07-18  Jonathan Nieder  <jrnieder@gmail.com>

	Teach statvfs and fstatvfs to retrieve the noatime flag, so
	libio/tst-atime can know what to expect.
	Reported by Robert Millan.
	* bits/statvfs.h: Define ST_NOATIME.  Value is from the generic
	bits/statvfs.h.
	* statfsconv.c (statfs5_to_statvfs): Set ST_NOATIME bit when the
	MNT_NOATIME flag is set.

 bits/statvfs.h |    4 +++-
 statfsconv.c   |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

--- a/bits/statvfs.h	
+++ b/bits/statvfs.h	
@@ -89,7 +89,9 @@ enum
 # define ST_NODEV	ST_NODEV
   ST_NOEXEC = 8,		/* Disallow program execution.  */
 # define ST_NOEXEC	ST_NOEXEC
-  ST_SYNCHRONOUS = 16		/* Writes are synced at once.  */
+  ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
 # define ST_SYNCHRONOUS	ST_SYNCHRONOUS
+  ST_NOATIME = 1024,		/* Do not update access times.  */
+# define ST_NOATIME	ST_NOATIME
 #endif	/* Use GNU.  */
 };
--- a/statfsconv.c	
+++ b/statfsconv.c	
@@ -164,7 +164,8 @@ statfs5_to_statvfs (const struct statfs_fbsd5 *pk,
     | (pk->f_flags & MNT_NOSUID ? ST_NOSUID : 0)
     | (pk->f_flags & MNT_NODEV ? ST_NODEV : 0)
     | (pk->f_flags & MNT_NOEXEC ? ST_NOEXEC : 0)
-    | (pk->f_flags & MNT_SYNCHRONOUS ? ST_SYNCHRONOUS : 0);
+    | (pk->f_flags & MNT_SYNCHRONOUS ? ST_SYNCHRONOUS : 0)
+    | (pk->f_flags & MNT_NOATIME ? ST_NOATIME : 0);
   p32->f_namemax	= pk->f_namemax;
 
   memset (p32->f_spare, '\0', sizeof (p32->f_spare));
@@ -196,7 +197,8 @@ statfs5_to_statvfs64 (const struct statfs_fbsd5 *p
     | (pk->f_flags & MNT_NOSUID ? ST_NOSUID : 0)
     | (pk->f_flags & MNT_NODEV ? ST_NODEV : 0)
     | (pk->f_flags & MNT_NOEXEC ? ST_NOEXEC : 0)
-    | (pk->f_flags & MNT_SYNCHRONOUS ? ST_SYNCHRONOUS : 0);
+    | (pk->f_flags & MNT_SYNCHRONOUS ? ST_SYNCHRONOUS : 0)
+    | (pk->f_flags & MNT_NOATIME ? ST_NOATIME : 0);
   p64->f_namemax	= pk->f_namemax;
 
   memset (p64->f_spare, '\0', sizeof (p64->f_spare));
-- 



Reply to: