From: Ryan Haasken Date: Wed, 7 May 2014 21:33:24 +0000 (-0500) Subject: LU-5026 obdclass: Add lbug_on_eviction option X-Git-Tag: 2.11.56~61 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=97381ffc9231a9e8b997fd3b4d66c9c5ade1b4d0;p=fs%2Flustre-release.git LU-5026 obdclass: Add lbug_on_eviction option Add an lbug_on_eviction sysfs interface. When it is set to a non-zero value on a client, it will cause the client to LBUG whenever it is evicted by the server. Note, an MDS is a client to OSTs, and every server is a client of MGS. Thus, it is probably desireable to leave this set to zero on servers. Change-Id: I2f694e4bc1b1ec9daf52f8a6ac46ad87f40f810f Cray-bug-id: LUS-2591 Signed-off-by: Ryan Haasken Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/10257 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alexandr Boyko Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 265a3b8..60e6ac8 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -53,6 +53,7 @@ enum { extern unsigned int obd_debug_peer_on_timeout; extern unsigned int obd_dump_on_timeout; extern unsigned int obd_dump_on_eviction; +extern unsigned int obd_lbug_on_eviction; /* obd_timeout should only be used for recovery, not for networking / disk / timings affected by load (use Adaptive Timeouts) */ extern unsigned int obd_timeout; /* seconds */ diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 9bb407c..d408915 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -69,6 +69,8 @@ unsigned int obd_dump_on_timeout; EXPORT_SYMBOL(obd_dump_on_timeout); unsigned int obd_dump_on_eviction; EXPORT_SYMBOL(obd_dump_on_eviction); +unsigned int obd_lbug_on_eviction; +EXPORT_SYMBOL(obd_lbug_on_eviction); unsigned long obd_max_dirty_pages; EXPORT_SYMBOL(obd_max_dirty_pages); atomic_long_t obd_dirty_pages; diff --git a/lustre/obdclass/obd_sysfs.c b/lustre/obdclass/obd_sysfs.c index 64ab464..a297e52 100644 --- a/lustre/obdclass/obd_sysfs.c +++ b/lustre/obdclass/obd_sysfs.c @@ -121,6 +121,7 @@ LUSTRE_STATIC_UINT_ATTR(at_max, &at_max); LUSTRE_STATIC_UINT_ATTR(at_extra, &at_extra); LUSTRE_STATIC_UINT_ATTR(at_early_margin, &at_early_margin); LUSTRE_STATIC_UINT_ATTR(at_history, &at_history); +LUSTRE_STATIC_UINT_ATTR(lbug_on_eviction, &obd_lbug_on_eviction); #ifdef HAVE_SERVER_SUPPORT LUSTRE_STATIC_UINT_ATTR(ldlm_timeout, &ldlm_timeout); @@ -351,6 +352,7 @@ static struct attribute *lustre_attrs[] = { &lustre_sattr_ldlm_timeout.u.attr, &lustre_sattr_bulk_timeout.u.attr, #endif + &lustre_sattr_lbug_on_eviction.u.attr, NULL, }; diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index dd9ba73..241c1a7 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1461,6 +1461,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) "using this service will fail.\n", imp->imp_obd->obd_name, target_len, target_start); + LASSERTF(!obd_lbug_on_eviction, "LBUG upon eviction"); } CDEBUG(D_HA, "evicted from %s@%s; invalidating\n", obd2cli_tgt(imp->imp_obd),