From 8fe1fb14cb242033a1dc34aedbe35267c8d2f224 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 9 Dec 2015 11:00:35 -0800 Subject: [PATCH] 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 Closes #4069 Closes #4080 --- module/zfs/arc.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 7bcb7e3ee3..04fde6c167 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4319,17 +4319,11 @@ top: /* * 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; }