Whamcloud - gitweb
LU-10531 obd: handle case tgt equals fsname for obdname2fsname 08/31208/2
authorJames Simmons <uja.ornl@yahoo.com>
Fri, 19 Jan 2018 07:55:11 +0000 (02:55 -0500)
committerJohn L. Hammond <john.hammond@intel.com>
Fri, 9 Feb 2018 22:30:05 +0000 (22:30 +0000)
The function obdname2fsname() was updated to handle the case of
when tgt was for the format:

llite.lustre*.xattr_cache
llite.lustre-*.xattr_cache

but the case of tgt being exactly equal to the fsname is also
valid as in the case of sptlrpc: fsname.srpc.flavor.default.cli2ost

Lustre-change: https://review.whamcloud.com/30937
Lustre-commit: ac01abc2db2e82f87061eb0e6b2c03e28dad6a5b

Change-Id: I9bb4082ee5f194842c7d72ae25e14f6998c0b8ed
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/31208
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/obdclass/obd_mount.c
lustre/ptlrpc/sec_config.c

index e2b1166..ed1a1d7 100644 (file)
@@ -695,10 +695,13 @@ void obdname2fsname(const char *tgt, char *fsname, size_t buflen)
         */
        ptr = strrchr(tgt, '-');
        if (!ptr) {
-               /* No '-' means it should end in '*' */
+               /* No '-' means it could end in '*' */
                ptr = strchr(tgt, '*');
-               if (!ptr)
-                       goto no_fsname;
+               if (!ptr) {
+                       /* No '*' either. Assume tgt = fsname */
+                       len = strlen(tgt);
+                       goto valid_obd_name;
+               }
                len = ptr - tgt;
                goto valid_obd_name;
        }
index 6c920c4..550abea 100644 (file)
@@ -625,7 +625,9 @@ static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
         char                    fsname[MTI_NAME_MAXLEN];
         struct sptlrpc_rule     rule;
         int                     rc;
-        ENTRY;
+
+       ENTRY;
+       print_lustre_cfg(lcfg);
 
         target = lustre_cfg_string(lcfg, 1);
         if (target == NULL) {