mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
dmu_recv_begin_check: dsl_dataset_rele() should be called on ds
We call dsl_dataset_hold() to initialize ds, and are supposed to call dsl_dataset_rele() on ds when we are done. In two error paths, we call dsl_dataset_rele_flags(). If ds is an encrypted dataset, this can drop the key mapping for the dataset, which will cause run time issues. On unencrypted datasets, this is a no-op. Reported-by: Grok 4.6 Build Beta Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #18961
This commit is contained in:
1 parent
0d945dbcb3
commit
acbcdd92cf
1 file changed
+2
-3
@@ -850,8 +850,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx)
|
||||
if (!redact_check(drba, origin)) {
|
||||
dsl_dataset_rele_flags(origin, dsflags,
|
||||
FTAG);
|
||||
dsl_dataset_rele_flags(ds, dsflags,
|
||||
FTAG);
|
||||
dsl_dataset_rele(ds, FTAG);
|
||||
return (SET_ERROR(EINVAL));
|
||||
}
|
||||
}
|
||||
@@ -859,7 +858,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx)
|
||||
error = recv_check_large_blocks(ds, featureflags);
|
||||
if (error != 0) {
|
||||
dsl_dataset_rele_flags(origin, dsflags, FTAG);
|
||||
dsl_dataset_rele_flags(ds, dsflags, FTAG);
|
||||
dsl_dataset_rele(ds, FTAG);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user