svn commit: r227704 -
stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sat Nov 19 10:28:08 UTC 2011
Author: pjd
Date: Sat Nov 19 10:28:06 2011
New Revision: 227704
URL: http://svn.freebsd.org/changeset/base/227704
Log:
MFC r226617:
zfs vdev_file_io_start: validate vdev before using vdev_tsd
vdev_tsd can be NULL for certain vdev states.
At least in userland testing with ztest.
Submitted by: avg
Approved by: re (kib)
Modified:
stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 10:26:34 2011 (r227703)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 10:28:06 2011 (r227704)
@@ -153,17 +153,19 @@ static int
vdev_file_io_start(zio_t *zio)
{
vdev_t *vd = zio->io_vd;
- vdev_file_t *vf = vd->vdev_tsd;
- vnode_t *vp = vf->vf_vnode;
+ vdev_file_t *vf;
+ vnode_t *vp;
ssize_t resid;
- if (zio->io_type == ZIO_TYPE_IOCTL) {
- /* XXPOLICY */
- if (!vdev_readable(vd)) {
- zio->io_error = ENXIO;
- return (ZIO_PIPELINE_CONTINUE);
- }
+ if (!vdev_readable(vd)) {
+ zio->io_error = ENXIO;
+ return (ZIO_PIPELINE_CONTINUE);
+ }
+
+ vf = vd->vdev_tsd;
+ vp = vf->vf_vnode;
+ if (zio->io_type == ZIO_TYPE_IOCTL) {
switch (zio->io_cmd) {
case DKIOCFLUSHWRITECACHE:
zio->io_error = VOP_FSYNC(vp, FSYNC | FDSYNC,
More information about the svn-src-stable-9
mailing list