From 34a15de1432814f848f7c794664f0048daa3f9ef Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Sat, 28 May 2022 09:59:03 +0300 Subject: [PATCH] LU-15900 hsm: don't return error on state change during mount HSM coordinator is started in stopped state always, but mount may have hsm_control parameters 'disabled'. Such parameter cause wrong state change so mount would fail with error. Treat parameter change from 'stopping/stopped' to 'disabled' as not critical error, keep state unchanged and report no error back to a caller. Signed-off-by: Mikhail Pershin Change-Id: I9d1366423391971b9511c46b6aed39d21ebf637c Reviewed-on: https://review.whamcloud.com/47473 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_coordinator.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c index 0ff12de..d0885d0 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -2295,9 +2295,10 @@ ssize_t hsm_control_store(struct kobject *kobj, struct attribute *attr, strlen(CDT_DISABLE_CMD)) == 0) { if ((cdt->cdt_state == CDT_STOPPING) || (cdt->cdt_state == CDT_STOPPED)) { - CERROR("%s: Coordinator is stopped\n", - mdt_obd_name(mdt)); - rc = -EINVAL; + /* exit gracefully if coordinator is being stopped + * or stopped already. + */ + rc = 0; } else { rc = set_cdt_state(cdt, CDT_DISABLE); } -- 1.8.3.1