Skip to content

Commit

Permalink
Properly release key in spa_keystore_dsl_key_hold_dd()
Browse files Browse the repository at this point in the history
Since dsl_crypto_key_open() references the key, 0d23f5e should
have called dsl_crypto_key_rele() to drop it first instead of
calling dsl_crypto_key_free() directly.  The final result should
actually be the same, but without triggering dck_holds assertion.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
  • Loading branch information
amotin committed Sep 24, 2024
1 parent ccc420a commit 3bc485d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/dsl_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ spa_keystore_dsl_key_hold_dd(spa_t *spa, dsl_dir_t *dd, const void *tag,
avl_insert(&spa->spa_keystore.sk_dsl_keys, dck_io, where);
*dck_out = dck_io;
} else {
dsl_crypto_key_free(dck_io);
dsl_crypto_key_rele(dck_io, tag);
*dck_out = dck_ks;
}

Expand Down

0 comments on commit 3bc485d

Please sign in to comment.