From e1b10b084ebc74a0ce74538caa329775181b329b Mon Sep 17 00:00:00 2001 From: Alexander Boyko Date: Mon, 7 Oct 2019 06:39:25 -0400 Subject: [PATCH] LU-12833 obdclass: fix LWP config processing In the situation when config includes SKIP records for command add mdc. LWP config processing interprets add_conn as valid and fails to add connection because there is no LWP device. lustre_lwp_add_conn()) lustre-OST0000: can't find lwp device. server_start_targets()) lustre-OST0000: failed to start LWP: -2 The fix adds checking for CFG_F_MARKER and CFG_F_SKIP before adding connection. These flags shows that marker was not in SKIP state, device and uuid was added. Cray-bug-id: LUS-7933 Signed-off-by: Alexander Boyko Change-Id: Idbf709bb46a0be958946048fb16d3b622d2edd1f Reviewed-on: https://review.whamcloud.com/36391 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alexander Zarochentsev Reviewed-by: Oleg Drokin --- lustre/obdclass/obd_mount_server.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lustre/obdclass/obd_mount_server.c b/lustre/obdclass/obd_mount_server.c index 48b5845..4083215 100644 --- a/lustre/obdclass/obd_mount_server.c +++ b/lustre/obdclass/obd_mount_server.c @@ -881,6 +881,20 @@ static int client_lwp_config_process(const struct lu_env *env, if (!is_mdc_device(devname)) break; + if (!(cfg->cfg_flags & CFG_F_MARKER)) { + CDEBUG(D_CONFIG, "Skipping add_conn for %s, rec %d\n", + devname, rec->lrh_index); + break; + } + + /* add_conn should follow by add_uuid. This + * guarantee lwp device was created + */ + if (!(cfg->cfg_flags & CFG_F_SKIP)) { + CWARN("Error at config for %s rec %d, add_conn should follow by add_uuid\n", + devname, rec->lrh_index); + break; + } ptr = strrchr(devname, '-'); if (ptr == NULL) break; -- 1.8.3.1