Skip to content

Commit

Permalink
Update outdated assertion from zio_write_compress
Browse files Browse the repository at this point in the history
As part of some internal gang block testing within Delphix
we hit the assertion removed by this patch. The assertion
was triggered by a ZIO that had two copies and was a gang
block making the following expression equal to 3:
```
MIN(zp->zp_copies + BP_IS_GANG(bp), spa_max_replication(spa))
```
and failing when we expected the above to be equal to
`BP_GET_NDVAS(bp)`.

The assertion is no longer valid since the following commit:
```
commit 14872aa
Author: Matthew Ahrens <matthew.ahrens@delphix.com>
Date:   Mon Feb 6 09:37:06 2023 -0800

  EIO caused by encryption + recursive gang
```

The above commit changed gang block headers so they can't
have more than 2 copies but the assertion in question from
this PR was never updated.

Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
  • Loading branch information
sdimitro committed Aug 17, 2023
1 parent cae502c commit 930a100
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1774,9 +1774,9 @@ zio_write_compress(zio_t *zio)
if (pass >= zfs_sync_pass_dont_compress)
compress = ZIO_COMPRESS_OFF;

/* Make sure someone doesn't change their mind on overwrites */
ASSERT(BP_IS_EMBEDDED(bp) || MIN(zp->zp_copies + BP_IS_GANG(bp),
spa_max_replication(spa)) == BP_GET_NDVAS(bp));
ASSERT(BP_IS_EMBEDDED(bp) || BP_IS_GANG(bp) ||
MIN(zp->zp_copies, spa_max_replication(spa))
== BP_GET_NDVAS(bp));
}

/* If it's a compressed write that is not raw, compress the buffer. */
Expand Down

0 comments on commit 930a100

Please sign in to comment.