From 83fa80a5500ed7baccedfa90ad55ac879af710c9 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 20 May 2025 11:35:45 -0400 Subject: [PATCH] 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 Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Richard Yao Closes #17353 --- module/zfs/dmu_objset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c index c6ec60721..d08252e3c 100644 --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@ -765,7 +765,7 @@ dmu_objset_hold_flags(const char *name, boolean_t decrypt, const void *tag, err = dmu_objset_from_ds(ds, osp); if (err != 0) { - dsl_dataset_rele(ds, tag); + dsl_dataset_rele_flags(ds, flags, tag); dsl_pool_rele(dp, tag); }