diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 7124f3d6a8..9bbb6fae23 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -671,7 +671,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); }