Whamcloud - gitweb
LU-12833 obdclass: fix LWP config processing 91/36391/2
authorAlexander Boyko <c17825@cray.com>
Mon, 7 Oct 2019 10:39:25 +0000 (06:39 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 6 Dec 2019 01:30:48 +0000 (01:30 +0000)
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 <c17825@cray.com>
Change-Id: Idbf709bb46a0be958946048fb16d3b622d2edd1f
Reviewed-on: https://review.whamcloud.com/36391
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/obd_mount_server.c

index 48b5845..4083215 100644 (file)
@@ -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;