diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 168aea861637..ad944e5b8ea2 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -867,11 +867,11 @@ dsl_dataset_namelen(dsl_dataset_t *ds) VERIFY0(dsl_dataset_get_snapname(ds)); mutex_enter(&ds->ds_lock); int len = strlen(ds->ds_snapname); + mutex_exit(&ds->ds_lock); /* add '@' if ds is a snap */ if (len > 0) len++; len += dsl_dir_namelen(ds->ds_dir); - mutex_exit(&ds->ds_lock); return (len); }