From: cliffw Date: Wed, 9 May 2007 20:37:34 +0000 (+0000) Subject: b=11512 X-Git-Tag: v1_7_100~130 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=24b474e97d10deaf630a0ab42da85b29e91a65aa b=11512 i=wangdi i=shadow Removes write from health check, adds option to configure. --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 20e788f..2a8a086 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -399,6 +399,23 @@ fi ]) # +# LC_CONFIG_HEALTH_CHECK_WRITE +# +# Turn off the actual write to the disk +# +AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], +[AC_MSG_CHECKING([whether to enable a write with the health check]) +AC_ARG_ENABLE([health_write], + AC_HELP_STRING([--disable-health_write], + [disable disk writes when doing health check]), + [],[enable_health_write='yes']) +AC_MSG_RESULT([$enable_health_write]) +if test x$enable_health_write != xno ; then + AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health) +fi +]) + +# # LC_CONFIG_LIBLUSTRE_RECOVERY # AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY], @@ -1042,6 +1059,7 @@ fi LC_CONFIG_PINGER LC_CONFIG_LIBLUSTRE_RECOVERY LC_CONFIG_QUOTA +LC_CONFIG_HEALTH_CHECK_WRITE LC_TASK_PPTR diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index c53b906..3a99194 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -2652,14 +2652,18 @@ static struct dentry *mds_lvfs_fid2dentry(__u64 id, __u32 gen, __u64 gr, static int mds_health_check(struct obd_device *obd) { struct obd_device_target *odt = &obd->u.obt; +#ifdef USE_HEALTH_CHECK_WRITE struct mds_obd *mds = &obd->u.mds; +#endif int rc = 0; if (odt->obt_sb->s_flags & MS_RDONLY) rc = 1; +#ifdef USE_HEALTH_CHECK_WRITE LASSERT(mds->mds_health_check_filp != NULL); rc |= !!lvfs_check_io_health(obd, mds->mds_health_check_filp); +#endif return rc; } diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index cbbafbc..6974d87 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -3329,7 +3329,9 @@ int filter_iocontrol(unsigned int cmd, struct obd_export *exp, static int filter_health_check(struct obd_device *obd) { +#ifdef USE_HEALTH_CHECK_WRITE struct filter_obd *filter = &obd->u.filter; +#endif int rc = 0; /* @@ -3339,8 +3341,10 @@ static int filter_health_check(struct obd_device *obd) if (obd->u.obt.obt_sb->s_flags & MS_RDONLY) rc = 1; +#ifdef USE_HEALTH_CHECK_WRITE LASSERT(filter->fo_health_check_filp != NULL); rc |= !!lvfs_check_io_health(obd, filter->fo_health_check_filp); +#endif return rc; }