svn commit: r258704 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Thu Nov 28 08:48:49 UTC 2013


Author: avg
Date: Thu Nov 28 08:48:49 2013
New Revision: 258704
URL: http://svnweb.freebsd.org/changeset/base/258704

Log:
  fix a serious bug in r258632: offset parameter must be set in zio
  
  In illumos all ioctl zio-s are "global" at the moment.  That is they act
  on a whole disk, e.g. a cache flush command, and thus do not need either
  offset or size parameters.
  FreeBSD, on the other hand, has support for TRIM command and that
  command requires proper offset and size parameters.
  Without this fix all TRIM commands act on the start of any disk or
  partition used by ZFS destroying any data there.
  
  Pointyhat to:	avg
  Tested by:	sbruno
  MFC after:	3 days
  X-MFC with:	r258632
  Sponsored by:	HybridCluster

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Nov 28 07:09:58 2013	(r258703)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Nov 28 08:48:49 2013	(r258704)
@@ -843,7 +843,7 @@ zio_ioctl(zio_t *pio, spa_t *spa, vdev_t
 
 	if (vd->vdev_children == 0) {
 		zio = zio_create(pio, spa, 0, NULL, NULL, size, done, private,
-		    ZIO_TYPE_IOCTL, ZIO_PRIORITY_NOW, flags, vd, 0, NULL,
+		    ZIO_TYPE_IOCTL, ZIO_PRIORITY_NOW, flags, vd, offset, NULL,
 		    ZIO_STAGE_OPEN, ZIO_IOCTL_PIPELINE);
 
 		zio->io_cmd = cmd;


More information about the svn-src-head mailing list