Whamcloud - gitweb
LU-13340 lustre: Support large nids in LCFG_ADD_UUID
[fs/lustre-release.git] / lustre / obdclass / obd_config.c
index 431d0a5..e397312 100644 (file)
@@ -1398,8 +1398,19 @@ int class_process_config(struct lustre_cfg *lcfg)
                       lustre_cfg_string(lcfg, 1), lcfg->lcfg_nid,
                       libcfs_nid2str(lcfg->lcfg_nid));
 
-               lnet_nid4_to_nid(lcfg->lcfg_nid, &nid);
-               err = class_add_uuid(lustre_cfg_string(lcfg, 1), &nid);
+               err = 0;
+               if (lcfg->lcfg_nid) {
+                       lnet_nid4_to_nid(lcfg->lcfg_nid, &nid);
+               } else {
+                       char *nidstr = lustre_cfg_string(lcfg, 2);
+
+                       if (nidstr)
+                               err = libcfs_strnid(&nid, nidstr);
+                       else
+                               err = -EINVAL;
+               }
+               if (!err)
+                       err = class_add_uuid(lustre_cfg_string(lcfg, 1), &nid);
                GOTO(out, err);
        }
        case LCFG_DEL_UUID: {