From 5319713494a747eb47366e5abb4ba78383c6e531 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Thu, 21 Dec 2017 20:09:30 +0800 Subject: [PATCH] LU-10120 lsnapshot: handle dash in fsname '-' is a valid character for Lustre fsname. Replace "strchr()" with "strrchr()" to correctly parse fsname from configuration. Signed-off-by: Fan Yong Signed-off-by: Darby Vicker Change-Id: Ib972288668f1b7bcf1f9188c0e9cc77027e7ceeb Reviewed-on: https://review.whamcloud.com/30626 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam --- lustre/utils/lsnapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/utils/lsnapshot.c b/lustre/utils/lsnapshot.c index 898230b..3d79674 100644 --- a/lustre/utils/lsnapshot.c +++ b/lustre/utils/lsnapshot.c @@ -268,7 +268,7 @@ static int snapshot_load_conf_ldev(struct snapshot_instance *si, char *buf, /* Format of label: * fsname- or */ - ptr = strchr(label, '-'); + ptr = strrchr(label, '-'); if (ptr) { if (strncmp(si->si_fsname, label, ptr - label) != 0) { /* This line is NOT for current filesystem .*/ -- 1.8.3.1