Skip to content

Commit

Permalink
Don't count '@' for dataset namelen if not a snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: Chunwei Chen <[email protected]>
Fix openzfs#5432
  • Loading branch information
Chunwei Chen committed Dec 3, 2016
1 parent e8a2014 commit eacd2b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion module/zfs/dsl_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit eacd2b0

Please sign in to comment.