Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c (wersja 246876) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c (kopia robocza) @@ -2555,7 +2555,13 @@ } } - 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); } @@ -2577,7 +2583,8 @@ 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) { + zio->io_type == ZIO_TYPE_WRITE && + !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) { trim_map_write_done(zio); }