[LU-10120] ZFS snapshots break when fsname contains a dash Created: 13/Oct/17  Updated: 14/Jun/18  Resolved: 14/Jun/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.10.0
Fix Version/s: Lustre 2.12.0

Type: Bug Priority: Minor
Reporter: Darby Vicker Assignee: nasf (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Epic/Theme: snapshots, zfs
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Our fsname contains a dash, which we found breaks snapshots.  The following change corrects the problem.  

 

  

diff --git a/lustre/utils/lsnapshot.c b/lustre/utils/lsnapshot.c
index 4fef5c0..f08cc9e 100644
--- a/lustre/utils/lsnapshot.c
+++ b/lustre/utils/lsnapshot.c
@@ -253,7 +253,8 @@ static int snapshot_load_conf_ldev(struct snapshot_instance 
 
        /* Format of label:
         * fsname-<role><index> or <role><index> */
-       ptr = strchr(label, '-');
+       ptr = strrchr(label, '-'); /* use strrchr to handle the case when fsname
+                                      contains a '-' */
        if (ptr) {
                if (strncmp(si->si_fsname, label, ptr - label) != 0) {
                        /* This line is NOT for current filesystem .*/

 

 

 



 Comments   
Comment by Gerrit Updater [ 21/Dec/17 ]

Fan Yong (fan.yong@intel.com) uploaded a new patch: https://review.whamcloud.com/30626
Subject: LU-10120 lsnapshot: handle dash in fsname
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 686d7f4bfd2bf822af8dd70f9b53a82453044deb

Comment by Gerrit Updater [ 14/Jun/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30626/
Subject: LU-10120 lsnapshot: handle dash in fsname
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 5319713494a747eb47366e5abb4ba78383c6e531

Comment by nasf (Inactive) [ 14/Jun/18 ]

The patch has been landed to master.

Generated at Sat Feb 10 02:32:14 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.