aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zio.c
diff options
context:
space:
mode:
authorGeorge Amanakis <[email protected]>2021-06-17 03:17:42 +0300
committerGitHub <[email protected]>2021-06-16 18:17:42 -0600
commit9ffcaa370aee6871c92c7c84aa65942fba63a884 (patch)
tree8bc8dad3a14c17f0a17279867e9edcdfa174757b /module/zfs/zio.c
parentff3175040572baae1aacf5d9062192c5df849030 (diff)
Avoid deadlock when removing L2ARC devices under I/O
In case we have I/O and try to remove an L2ARC device a deadlock might occur. arc_read()->zio_read()->zfs_blkptr_verify() waits for SCL_VDEV to be dropped while holding the hash_lock. However, spa_l2cache_load() holds SCL_ALL and waits for the hash_lock in l2arc_evict(). Fix this by moving zfs_blkptr_verify() to the top top arc_read() before the hash_lock is taken. Verify the block pointer and return a checksum error if damaged rather than halting the system, by using BLK_VERIFY_LOG instead of BLK_VERIFY_HALT. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Mark Maybee <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #12054
Diffstat (limited to 'module/zfs/zio.c')
-rw-r--r--module/zfs/zio.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 87ccb6861..66ac545c7 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -1107,9 +1107,6 @@ zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
{
zio_t *zio;
- (void) zfs_blkptr_verify(spa, bp, flags & ZIO_FLAG_CONFIG_WRITER,
- BLK_VERIFY_HALT);
-
zio = zio_create(pio, spa, BP_PHYSICAL_BIRTH(bp), bp,
data, size, size, done, private,
ZIO_TYPE_READ, priority, flags, NULL, 0, zb,