From 4c0dbac2c26202dcacfdea485238ef73fbcb4183 Mon Sep 17 00:00:00 2001 From: Bob Glossman Date: Fri, 16 Nov 2012 08:40:08 -0800 Subject: [PATCH] LU-1783 tests: test failure on sanity, subtest 39l 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 Change-Id: I65876761065fc11c74a56bc4b5a6b7910c9d241e Reviewed-on: http://review.whamcloud.com/4605 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Minh Diep --- lustre/tests/sanity.sh | 16 ---------------- lustre/utils/mkfs_lustre.c | 9 --------- lustre/utils/mount_lustre.c | 32 ++++++++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 1485418..35dfeb7 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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) diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 3af3a0a..498ca76 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -65,15 +65,6 @@ #include #include -#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 -#ifndef BLKGETSIZE64 -#include /* for BLKGETSIZE64 */ -#endif -#include -#endif #include #include #include diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 8d93092..2ef7358 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -53,6 +53,19 @@ #include #include #include +#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 +#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); -- 1.8.3.1