Skip to content

Commit

Permalink
Handle block pointers with a corrupt logical size
Browse files Browse the repository at this point in the history
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 <[email protected]>
Closes #4069
Closes #4080
  • Loading branch information
behlendorf authored and nedbass committed Sep 9, 2016
1 parent bf8b4a9 commit 8fe1fb1
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4319,17 +4319,11 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,

/*
* Gracefully handle a damaged logical block size as a
* checksum error by passing a dummy zio to the done callback.
* checksum error.
*/
if (size > spa_maxblocksize(spa)) {
if (done) {
rzio = zio_null(pio, spa, NULL,
NULL, NULL, zio_flags);
rzio->io_error = ECKSUM;
done(rzio, buf, private);
zio_nowait(rzio);
}
rc = ECKSUM;
ASSERT3P(buf, ==, NULL);
rc = SET_ERROR(ECKSUM);
goto out;
}

Expand Down

0 comments on commit 8fe1fb1

Please sign in to comment.