From patchwork Thu Feb 27 21:09:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36BAE14BC for ; Thu, 27 Feb 2020 21:24:44 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F64C246A0 for ; Thu, 27 Feb 2020 21:24:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F64C246A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 0BF8C348CEA; Thu, 27 Feb 2020 13:22:24 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 69B9821FAF4 for ; Thu, 27 Feb 2020 13:18:52 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 9CA68103E; Thu, 27 Feb 2020 16:18:14 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 9B47646C; Thu, 27 Feb 2020 16:18:14 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:09:45 -0500 Message-Id: <1582838290-17243-118-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 117/622] lustre: obdclass: Add lbug_on_eviction option X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ryan Haasken , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Ryan Haasken 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. Cray-bug-id: LUS-2591 WC-bug-id: https://jira.whamcloud.com/browse/LU-5026 Lustre-commit: 97381ffc9231 ("LU-5026 obdclass: Add lbug_on_eviction option") Signed-off-by: Ryan Haasken Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/10257 Reviewed-by: Andreas Dilger Reviewed-by: Alexandr Boyko Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/include/obd_support.h | 1 + fs/lustre/obdclass/class_obd.c | 2 ++ fs/lustre/obdclass/obd_sysfs.c | 2 ++ fs/lustre/ptlrpc/import.c | 1 + 4 files changed, 6 insertions(+) diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h index 3d14723..04ef76f 100644 --- a/fs/lustre/include/obd_support.h +++ b/fs/lustre/include/obd_support.h @@ -43,6 +43,7 @@ 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) */ diff --git a/fs/lustre/obdclass/class_obd.c b/fs/lustre/obdclass/class_obd.c index 7e436af..4ef9cca 100644 --- a/fs/lustre/obdclass/class_obd.c +++ b/fs/lustre/obdclass/class_obd.c @@ -56,6 +56,8 @@ 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/fs/lustre/obdclass/obd_sysfs.c b/fs/lustre/obdclass/obd_sysfs.c index cd2917e..73e44e7 100644 --- a/fs/lustre/obdclass/obd_sysfs.c +++ b/fs/lustre/obdclass/obd_sysfs.c @@ -118,6 +118,7 @@ static ssize_t static_uintvalue_store(struct kobject *kobj, 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); static ssize_t max_dirty_mb_show(struct kobject *kobj, struct attribute *attr, char *buf) @@ -280,6 +281,7 @@ static ssize_t jobid_name_store(struct kobject *kobj, struct attribute *attr, &lustre_sattr_at_extra.u.attr, &lustre_sattr_at_early_margin.u.attr, &lustre_sattr_at_history.u.attr, + &lustre_sattr_lbug_on_eviction.u.attr, NULL, }; diff --git a/fs/lustre/ptlrpc/import.c b/fs/lustre/ptlrpc/import.c index b11bb2f..73a345f 100644 --- a/fs/lustre/ptlrpc/import.c +++ b/fs/lustre/ptlrpc/import.c @@ -1385,6 +1385,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) "%s: This client was evicted by %.*s; in progress operations 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),