From: James Simmons Date: Fri, 19 Jan 2018 07:55:11 +0000 (-0500) Subject: LU-10531 obd: handle case tgt equals fsname for obdname2fsname X-Git-Tag: 2.10.58~34 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F30937%2F2;p=fs%2Flustre-release.git LU-10531 obd: handle case tgt equals fsname for obdname2fsname 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 Change-Id: I9bb4082ee5f194842c7d72ae25e14f6998c0b8ed Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/30937 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 4ad23a0..c3637e0 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -694,10 +694,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; } diff --git a/lustre/ptlrpc/sec_config.c b/lustre/ptlrpc/sec_config.c index dc3178c..b661ff8 100644 --- a/lustre/ptlrpc/sec_config.c +++ b/lustre/ptlrpc/sec_config.c @@ -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) {