Whamcloud - gitweb
LU-10120 lsnapshot: handle dash in fsname 26/30626/2
authorFan Yong <fan.yong@intel.com>
Thu, 21 Dec 2017 12:09:30 +0000 (20:09 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 14 Jun 2018 03:56:15 +0000 (03:56 +0000)
'-' is a valid character for Lustre fsname. Replace "strchr()"
with "strrchr()" to correctly parse fsname from configuration.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Signed-off-by: Darby Vicker <darby.vicker-1@nasa.gov>
Change-Id: Ib972288668f1b7bcf1f9188c0e9cc77027e7ceeb
Reviewed-on: https://review.whamcloud.com/30626
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
lustre/utils/lsnapshot.c

index 898230b..3d79674 100644 (file)
@@ -268,7 +268,7 @@ static int snapshot_load_conf_ldev(struct snapshot_instance *si, char *buf,
 
        /* Format of label:
         * fsname-<role><index> or <role><index> */
-       ptr = strchr(label, '-');
+       ptr = strrchr(label, '-');
        if (ptr) {
                if (strncmp(si->si_fsname, label, ptr - label) != 0) {
                        /* This line is NOT for current filesystem .*/