Skip to content

Commit

Permalink
Fix for metaslab_fastwrite_unmark() assert failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4267
  • Loading branch information
Tom Caputi authored and unset committed Oct 29, 2016
1 parent 6944d90 commit 1d47c30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1d47c30

Please sign in to comment.