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

ZFS snapshots break when fsname contains a dash

    XMLWordPrintable

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

          People

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

            Dates

              Created:
              Updated:
              Resolved: