diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2014-01-16 12:26:54 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2014-01-16 12:26:54 +0000 |
commit | 2f9a31944f57c209884a08bf74f90c3c93e11f2b (patch) | |
tree | d2e9c9c9f01a4cb9de1295043008ede80cb23faf /sys | |
parent | b8ca4667ede8f034ff63c7d99bd02b515587a1c2 (diff) | |
download | src-2f9a31944f57c209884a08bf74f90c3c93e11f2b.tar.gz src-2f9a31944f57c209884a08bf74f90c3c93e11f2b.zip |
fix a bug in ZFS mirror code for handling multiple DVAa
The bug was introduced in r256956 "Improve ZFS N-way mirror read
performance".
The code in vdev_mirror_dva_select erroneously considers already
tried DVAs for the next attempt. Thus, it is possible that a failing DVA
would be retried forever.
As a secondary effect, if the attempts fail with checksum error, then
checksum error reports are accumulated until the original request
ultimately fails or succeeds. But because retrying is going on indefinitely
the cheksum reports accumulation will effectively be a memory leak.
Reviewed by: gibbs
MFC after: 13 days
Sponsored by: HybridCluster
Notes
Notes:
svn path=/head/; revision=260705
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c index 1ffd1de2731f..d4e1c0ded8af 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c @@ -317,9 +317,13 @@ vdev_mirror_dva_select(zio_t *zio, int preferred) { dva_t *dva = zio->io_bp->blk_dva; mirror_map_t *mm = zio->io_vsd; + mirror_child_t *mc; int c; for (c = preferred - 1; c >= 0; c--) { + mc = &mm->mm_child[c]; + if (mc->mc_tried || mc->mc_skipped) + continue; if (DVA_GET_VDEV(&dva[c]) == DVA_GET_VDEV(&dva[preferred])) preferred = c; } |