Whamcloud - gitweb
EX-3687 osp: do force disconnect if import is not ready 53/44753/4
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 25 Aug 2021 17:03:47 +0000 (20:03 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 17 Sep 2021 14:10:40 +0000 (14:10 +0000)
Send OSP_DISCONNECT only on health import. Otherwise,
force local disconnect for unhealthy imports.

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Icd9f171271f4e17a65503fcc710ad3aaa2b84e1e
Reviewed-on: https://review.whamcloud.com/44753
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/osp_dev.c

index 8c05af9..b36842f 100644 (file)
@@ -479,6 +479,11 @@ static int osp_disconnect(struct osp_device *d)
         * never added.) */
        (void)ptlrpc_pinger_del_import(imp);
 
+       /* Send disconnect on healthy import, do force disconnect otherwise */
+       spin_lock(&imp->imp_lock);
+       imp->imp_obd->obd_force = imp->imp_state != LUSTRE_IMP_FULL;
+       spin_unlock(&imp->imp_lock);
+
        rc = ptlrpc_disconnect_import(imp, 0);
        if (rc != 0)
                CERROR("%s: can't disconnect: rc = %d\n", obd->obd_name, rc);