Skip to content

Commit 8fe1fb1

Browse files
behlendorfnedbass
authored andcommitted
Handle block pointers with a corrupt logical size
Commit 5f6d0b6 was originally added to gracefully handle block pointers with a damaged logical size. However, it incorrectly assumed that all passed arc_done_func_t could handle a NULL arc_buf_t. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #4069 Closes #4080
1 parent bf8b4a9 commit 8fe1fb1

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

module/zfs/arc.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,17 +4319,11 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
43194319

43204320
/*
43214321
* Gracefully handle a damaged logical block size as a
4322-
* checksum error by passing a dummy zio to the done callback.
4322+
* checksum error.
43234323
*/
43244324
if (size > spa_maxblocksize(spa)) {
4325-
if (done) {
4326-
rzio = zio_null(pio, spa, NULL,
4327-
NULL, NULL, zio_flags);
4328-
rzio->io_error = ECKSUM;
4329-
done(rzio, buf, private);
4330-
zio_nowait(rzio);
4331-
}
4332-
rc = ECKSUM;
4325+
ASSERT3P(buf, ==, NULL);
4326+
rc = SET_ERROR(ECKSUM);
43334327
goto out;
43344328
}
43354329

0 commit comments

Comments
 (0)