@@ -2751,13 +2751,12 @@ zio_resume_wait(spa_t *spa)
27512751 *
27522752 * A gang block consists of a a gang header and up to gbh_nblkptrs(size)
27532753 * gang members. The gang header is like an indirect block: it's an array
2754- * of block pointers, though the header has a small tail (zio_gb_tail_t)
2755- * that stores a version number (for future compatibility) and an embedded
2756- * checksum. It is allocated using only a single sector as the requested
2757- * size, and hence is allocatable regardless of fragmentation. Its size
2758- * is determined by the smallest allocatable asize of the vdevs it was
2759- * allocated on. The gang header's bps point to its gang members,
2760- * which hold the data.
2754+ * of block pointers, though the header has a small tail (a zio_eck_t)
2755+ * that stores an embedded checksum. It is allocated using only a single
2756+ * sector as the requested size, and hence is allocatable regardless of
2757+ * fragmentation. Its size is determined by the smallest allocatable
2758+ * asize of the vdevs it was allocated on. The gang header's bps point
2759+ * to its gang members, which hold the data.
27612760 *
27622761 * Gang blocks are self-checksumming, using the bp's <vdev, offset, txg>
27632762 * as the verifier to ensure uniqueness of the SHA256 checksum.
@@ -3010,7 +3009,7 @@ zio_gang_tree_assemble_done(zio_t *zio)
30103009 abd_free (zio -> io_abd );
30113010
30123011 for (int g = 0 ; g < gbh_nblkptrs (gn -> gn_gangblocksize ); g ++ ) {
3013- blkptr_t * gbp = & (( blkptr_t * ) gn -> gn_gbh )[ g ] ;
3012+ blkptr_t * gbp = gbh_bp ( gn -> gn_gbh , g ) ;
30143013 if (!BP_IS_GANG (gbp ))
30153014 continue ;
30163015 zio_gang_tree_assemble (gio , gbp , & gn -> gn_child [g ]);
@@ -3039,7 +3038,7 @@ zio_gang_tree_issue(zio_t *pio, zio_gang_node_t *gn, blkptr_t *bp, abd_t *data,
30393038 gn -> gn_gangblocksize )-> zec_magic , = = , ZEC_MAGIC );
30403039
30413040 for (int g = 0 ; g < gbh_nblkptrs (gn -> gn_gangblocksize ); g ++ ) {
3042- blkptr_t * gbp = & (( blkptr_t * ) gn -> gn_gbh )[ g ] ;
3041+ blkptr_t * gbp = gbh_bp ( gn -> gn_gbh , g ) ;
30433042 if (BP_IS_HOLE (gbp ))
30443043 continue ;
30453044 zio_gang_tree_issue (zio , gn -> gn_child [g ], gbp , data ,
@@ -4399,7 +4398,7 @@ zio_dva_unallocate(zio_t *zio, zio_gang_node_t *gn, blkptr_t *bp)
43994398 if (gn != NULL ) {
44004399 for (int g = 0 ; g < gbh_nblkptrs (gn -> gn_gangblocksize ); g ++ ) {
44014400 zio_dva_unallocate (zio , gn -> gn_child [g ],
4402- & (( blkptr_t * ) gn -> gn_gbh )[ g ] );
4401+ gbh_bp ( gn -> gn_gbh , g ) );
44034402 }
44044403 }
44054404}
@@ -5344,6 +5343,7 @@ zio_dva_throttle_done(zio_t *zio)
53445343 * Parents of gang children can have two flavors -- ones that allocated
53455344 * the gang header (will have ZIO_FLAG_IO_REWRITE set) and ones that
53465345 * allocated the constituent blocks. The first use their parent as tag.
5346+ * We set the size to match the original allocation call for that case.
53475347 */
53485348 if (pio -> io_child_type == ZIO_CHILD_GANG &&
53495349 (pio -> io_flags & ZIO_FLAG_IO_REWRITE )) {
0 commit comments