dmu_objset_hold_flags() should call dsl_dataset_rele_flags() on error

This was caught when doing a manual check to see if #17352 needed to be
improved to catch mismatches across stack frames of the kind that were
first found in #17340.

Reviewed-by: George Amanakis <gamanakis@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Richard Yao <richard@ryao.dev>
Closes #17353
This commit is contained in:
Richard Yao 2025-05-20 11:35:45 -04:00 committed by GitHub
parent f0baaa329a
commit 83fa80a550
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -765,7 +765,7 @@ dmu_objset_hold_flags(const char *name, boolean_t decrypt, const void *tag,
err = dmu_objset_from_ds(ds, osp); err = dmu_objset_from_ds(ds, osp);
if (err != 0) { if (err != 0) {
dsl_dataset_rele(ds, tag); dsl_dataset_rele_flags(ds, flags, tag);
dsl_pool_rele(dp, tag); dsl_pool_rele(dp, tag);
} }