diff options
author | smh <smh@FreeBSD.org> | 2013-03-21 10:02:32 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2013-03-21 10:02:32 +0000 |
commit | f8b4607ac92c9c001eb2197ae2267368be41f2c2 (patch) | |
tree | fe2ae97f10840aa1b3878cbff830f2d429bbc105 /sys/cddl | |
parent | 0048458a8f8939aa311ce60b507da295ad4abe2f (diff) | |
download | FreeBSD-src-f8b4607ac92c9c001eb2197ae2267368be41f2c2.zip FreeBSD-src-f8b4607ac92c9c001eb2197ae2267368be41f2c2.tar.gz |
Don't register repair writes in the trim map.
The trim map inflight writes tree assumes non-conflicting writes, i.e.
that there will never be two simultaneous write I/Os to the same range
on the same vdev. This seemed like a sane assumption; however, in
actual testing, it appears that repair I/Os can very well conflict
with "normal" writes.
I'm not quite sure if these conflicting writes are supposed to happen
or not, but in the mean time, let's ignore repair writes for now. This
should be safe considering that, by definition, we never repair blocks
that are freed.
Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
Obtained from: Source: https://github.com/dechamps/zfs/commit/6a3cebaf7c5fcc92007280b5d403c15d0e61dfe3
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c index 1852338d..a62dfeb 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c @@ -2558,7 +2558,13 @@ zio_vdev_io_start(zio_t *zio) } } - if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE) { + /* + * Note that we ignore repair writes for TRIM because they can conflict + * with normal writes. This isn't an issue because, by definition, we + * only repair blocks that aren't freed. + */ + if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE && + !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) { if (!trim_map_write_start(zio)) return (ZIO_PIPELINE_STOP); } @@ -2580,13 +2586,12 @@ zio_vdev_io_done(zio_t *zio) zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); if (vd != NULL && vd->vdev_ops->vdev_op_leaf && - zio->io_type == ZIO_TYPE_WRITE) { - trim_map_write_done(zio); - } - - if (vd != NULL && vd->vdev_ops->vdev_op_leaf && (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) { + if (zio->io_type == ZIO_TYPE_WRITE && + !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) + trim_map_write_done(zio); + vdev_queue_io_done(zio); if (zio->io_type == ZIO_TYPE_WRITE) |