HomeFreeBSD

Add assertion to dsl_dataset_set_compression_sync

Description

Add assertion to dsl_dataset_set_compression_sync

Coverity pointed out that if we somehow receive SPA_FEATURE_NONE, we
will use a negative number as an array index. A defensive assertion
seems appropriate.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13872

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Sep 14 2022, 7:50 PM
GitHub <noreply@github.com>Committed on Sep 14 2022, 7:50 PM
Parents
rGd954ca19ba8b: Fix theoretical "use-after-free" in dbuf_prefetch_indirect_done()
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG4a6e8b99f517: Add assertion to dsl_dataset_set_compression_sync (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Sep 14 2022, 7:50 PM