aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dsl_dataset.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
index 9362d49bd..f2c40a3c4 100644
--- a/module/zfs/dsl_dataset.c
+++ b/module/zfs/dsl_dataset.c
@@ -705,7 +705,11 @@ dsl_dataset_namelen(dsl_dataset_t *ds)
int len;
VERIFY0(dsl_dataset_get_snapname(ds));
mutex_enter(&ds->ds_lock);
- len = dsl_dir_namelen(ds->ds_dir) + 1 + strlen(ds->ds_snapname);
+ len = strlen(ds->ds_snapname);
+ /* add '@' if ds is a snap */
+ if (len > 0)
+ len++;
+ len += dsl_dir_namelen(ds->ds_dir);
mutex_exit(&ds->ds_lock);
return (len);
}