]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix for metaslab_fastwrite_unmark() assert failure
authorTom Caputi <tcaputi@datto.com>
Fri, 22 Jul 2016 20:19:29 +0000 (16:19 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 25 Jul 2016 20:21:43 +0000 (13:21 -0700)
Currently there is an issue where metaslab_fastwrite_unmark() unmarks
fastwrites on vdev_t's that have never had fastwrites marked on them.
The 'fastwrite mark' is essentially a count of outstanding bytes that
will be written to a vdev and is used in syncing context. The problem
stems from the fact that the vdev_pending_fastwrite field is not being
transferred over when replacing a top-level vdev. As a result, the
metaslab is marked for fastwrite on the old vdev and unmarked on the
new one, which brings the fastwrite count below zero. This fix simply
assigns vdev_pending_fastwrite from the old vdev to the new one so
this count is not lost.

Signed-off-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4267

module/zfs/vdev.c

index 5d5e3c5d1093139784e85e06e48ea31aad0bb924..302458b73b2dec8c3636e7eb65d3d2b647069c91 100644 (file)
@@ -704,6 +704,7 @@ vdev_top_transfer(vdev_t *svd, vdev_t *tvd)
 
        ASSERT(tvd == tvd->vdev_top);
 
+       tvd->vdev_pending_fastwrite = svd->vdev_pending_fastwrite;
        tvd->vdev_ms_array = svd->vdev_ms_array;
        tvd->vdev_ms_shift = svd->vdev_ms_shift;
        tvd->vdev_ms_count = svd->vdev_ms_count;