[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 |
| Comment by Gerrit Updater [ 14/Jun/18 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30626/ |
| Comment by nasf (Inactive) [ 14/Jun/18 ] |
|
The patch has been landed to master. |