]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ztest fails assertion in zio_write_gang_member_ready()
authorMatthew Ahrens <mahrens@delphix.com>
Tue, 10 Jan 2023 00:43:45 +0000 (16:43 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Jan 2023 16:44:55 +0000 (08:44 -0800)
commit0156253d29a303bdcca3e535958e754d8f086e33
treed94f1ed8f3d2cac5ea6b57f6cb9e3fd087c988ba
parent3e0962a236d9181b3fc1027b249a062820e598ee
ztest fails assertion in zio_write_gang_member_ready()

Encrypted blocks can have up to 2 DVA's, as the third DVA is reserved
for the salt+IV.  However, dmu_write_policy() allows non-encrypted
blocks (e.g. DMU_OT_OBJSET) inside encrypted datasets to request and
allocate 3 DVA's, since they don't need a salt+IV (they are merely
authenicated).

However, if such a block becomes a gang block, the gang code incorrectly
limits the gang block header to 2 DVA's.  This leads to a "NDVAs
inversion", where a parent block (the gang block header) has less DVA's
than its children (the gang members), causing an assertion failure in
zio_write_gang_member_ready().

This commit addresses the problem by only restricting the gang block
header to 2 DVA's if the block is actually encrypted (and thus its gang
block members can have at most 2 DVA's).

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #14250
Closes #14356
module/zfs/zio.c