Whamcloud - gitweb
LU-1783 tests: test failure on sanity, subtest 39l
authorBob Glossman <bob.glossman@intel.com>
Fri, 16 Nov 2012 16:40:08 +0000 (08:40 -0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 4 Dec 2012 19:35:23 +0000 (14:35 -0500)
Failure of directory atime updates is due to bad build of mount.lustre in SLES.
Missing MS_* #defines led to mount.lustre being built in SLES
without conditional options and code related to atime mount options.
This caused all lustre mounts to be mounted with the option relatime.
Build fix puts back in all the supported options that were missing.
This mod also tears out the test skip put in previously to skip failing test,
since the test no longer fails.

Test-Parameters: clientdistro=sles11sp2 testlist=sanity

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I65876761065fc11c74a56bc4b5a6b7910c9d241e
Reviewed-on: http://review.whamcloud.com/4605
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
lustre/tests/sanity.sh
lustre/utils/mkfs_lustre.c
lustre/utils/mount_lustre.c

index 1485418..35dfeb7 100644 (file)
@@ -2584,23 +2584,7 @@ run_test 39k "write, utime, close, stat ========================"
 # this should be set to future
 TEST_39_ATIME=`date -d "1 year" +%s`
 
-is_sles11()                                            # LU-1783
-{
-       if [ -r /etc/SuSE-release ]
-       then
-               local vers=`grep VERSION /etc/SuSE-release | awk '{print $3}'`
-               local patchlev=`grep PATCHLEVEL /etc/SuSE-release \
-                       | awk '{print $3}'`
-               if [ $vers -eq 11 ] && [ $patchlev -eq 1 ]
-               then
-                       return 0
-               fi
-       fi
-       return 1
-}
-
 test_39l() {
-       is_sles11 && skip "SLES 11 SP1" && return       # LU-1783
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
        local atime_diff=$(do_facet $SINGLEMDS lctl get_param -n mdd.*.atime_diff)
 
index 3af3a0a..498ca76 100644 (file)
 #include <limits.h>
 #include <ctype.h>
 
-#ifdef __linux__
-/* libcfs.h is not really needed here, but on SLES10/PPC, fs.h includes idr.h
- * which requires BITS_PER_LONG to be defined */
-#include <libcfs/libcfs.h>
-#ifndef BLKGETSIZE64
-#include <linux/fs.h> /* for BLKGETSIZE64 */
-#endif
-#include <linux/version.h>
-#endif
 #include <lustre_disk.h>
 #include <lustre_param.h>
 #include <lnet/lnetctl.h>
index 8d93092..2ef7358 100644 (file)
 #include <lustre_ver.h>
 #include <ctype.h>
 #include <limits.h>
+#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 10, 51, 0)
+/*
+ * LU-1783
+ * We only #include a kernel level include file here because
+ * important MS_ flag #defines are missing from the SLES version
+ * of sys/mount.h
+ * In the future if SLES updates sys/mount.h to have a more complete
+ * set of flag #defines we should stop including linux/fs.h
+ */
+#warn remove kernel include
+#else
+#include <linux/fs.h>
+#endif
 
 #define MAXOPT 4096
 #define MAX_RETRIES 99
@@ -254,10 +267,21 @@ int parse_options(struct mount_opts *mop, char *orig_options, int *flagp)
                 }
         }
 #ifdef MS_STRICTATIME
-                /* set strictatime to default if NOATIME or RELATIME
-                   not given explicit */
-        if (!(*flagp & (MS_NOATIME | MS_RELATIME)))
-                *flagp |= MS_STRICTATIME;
+#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 10, 51, 0)
+/*
+ * LU-1783
+ * In the future when upstream fixes land in all supported kernels
+ * we should stop forcing MS_STRICTATIME in lustre mounts.
+ * We override the kernel level default of MS_RELATIME for now
+ * due to a kernel vfs level bug in atime updates that fails
+ * to reset timestamps from the future.
+ */
+#warn remove MS_STRICTATIME override
+#endif
+       /* set strictatime to default if NOATIME or RELATIME
+          not given explicit */
+       if (!(*flagp & (MS_NOATIME | MS_RELATIME)))
+               *flagp |= MS_STRICTATIME;
 #endif
         strcpy(orig_options, options);
         free(options);