Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-10120

ZFS snapshots break when fsname contains a dash

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.12.0
    • Lustre 2.10.0
    • None
    • 3
    • 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 .*/
      
      

       

       

       

      Attachments

        Activity

          [LU-10120] ZFS snapshots break when fsname contains a dash

          The patch has been landed to master.

          yong.fan nasf (Inactive) added a comment - The patch has been landed to master.

          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

          gerrit Gerrit Updater added a comment - 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

          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

          gerrit Gerrit Updater added a comment - 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

          People

            yong.fan nasf (Inactive)
            dvicker Darby Vicker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: