From cba8c65b384f92d269944042047f7a58d2808530 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 3 Apr 2023 14:31:26 -0600 Subject: [PATCH] LU-980 mount: improve mount/unmount messages In some cases, unmount errors are printed in multiple places, or are expected so printing them on the console log is not necessary. Conversely, some status messages such as mounting or unmounting the whole target should not be rate limited. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Id55f6ee3af5ad3cbe44a380314aa4b31f6b4bad3 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50511 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Olaf Faaland Reviewed-by: Oleg Drokin --- lustre/obdclass/obd_config.c | 4 ++-- lustre/osp/lwp_dev.c | 4 ---- lustre/target/tgt_mount.c | 7 ++++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 795a8de..861c58b 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -880,8 +880,8 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg) obd->obd_force = 1; break; case 'A': - LCONSOLE_WARN("Failing over %s\n", - obd->obd_name); + LCONSOLE(D_WARNING, "Failing over %s\n", + obd->obd_name); spin_lock(&obd->obd_dev_lock); obd->obd_fail = 1; #ifdef HAVE_SERVER_SUPPORT diff --git a/lustre/osp/lwp_dev.c b/lustre/osp/lwp_dev.c index 31ac7d0..bb76ff0 100644 --- a/lustre/osp/lwp_dev.c +++ b/lustre/osp/lwp_dev.c @@ -177,10 +177,6 @@ static int lwp_disconnect(struct lwp_device *d) */ ptlrpc_pinger_del_import(imp); rc = ptlrpc_disconnect_import(imp, 0); - if (rc != 0) - CWARN("%s: can't disconnect: rc = %d\n", - d->lpd_obd->obd_name, rc); - ptlrpc_invalidate_import(imp); RETURN(rc); diff --git a/lustre/target/tgt_mount.c b/lustre/target/tgt_mount.c index 9e99b94..54106c8 100644 --- a/lustre/target/tgt_mount.c +++ b/lustre/target/tgt_mount.c @@ -993,7 +993,8 @@ static int lustre_disconnect_lwp(struct super_block *sb) lwp->obd_lu_dev, lcfg); OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens)); - if (rc != 0 && rc != -ETIMEDOUT) { + if (rc != 0 && rc != -ETIMEDOUT && rc != -ENODEV && + rc != -ENOTCONN && rc != -ESHUTDOWN) { CERROR("%s: fail to disconnect LWP: rc = %d\n", lwp->obd_name, rc); rc1 = rc; @@ -1621,7 +1622,7 @@ static void server_put_super(struct super_block *sb) int rc; rc = lustre_disconnect_lwp(sb); - if (rc != 0 && rc != -ETIMEDOUT && + if (rc != 0 && rc != -ETIMEDOUT && rc != -ENODEV && rc != -ENOTCONN && rc != -ESHUTDOWN) CWARN("%s: failed to disconnect lwp: rc= %d\n", tmpname, rc); @@ -1715,7 +1716,7 @@ static void server_put_super(struct super_block *sb) OBD_FREE(extraname, strlen(extraname) + 1); } - LCONSOLE_WARN("server umount %s complete\n", tmpname); + LCONSOLE(D_WARNING, "server umount %s complete\n", tmpname); OBD_FREE(tmpname, tmpname_sz); EXIT; } -- 1.8.3.1