Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2010 12:24:59 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r207061 - stable/8/sys/geom
Message-ID:  <201004221224.o3MCOxcW075378@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Apr 22 12:24:59 2010
New Revision: 207061
URL: http://svn.freebsd.org/changeset/base/207061

Log:
  MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO

Modified:
  stable/8/sys/geom/geom_io.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/geom/geom_io.c
==============================================================================
--- stable/8/sys/geom/geom_io.c	Thu Apr 22 12:12:52 2010	(r207060)
+++ stable/8/sys/geom/geom_io.c	Thu Apr 22 12:24:59 2010	(r207061)
@@ -309,8 +309,8 @@ g_io_check(struct bio *bp)
 	case BIO_READ:
 	case BIO_WRITE:
 	case BIO_DELETE:
-		/* Zero sectorsize is a probably lack of media */
-		if (pp->sectorsize == 0)
+		/* Zero sectorsize or mediasize is probably a lack of media. */
+		if (pp->sectorsize == 0 || pp->mediasize == 0)
 			return (ENXIO);
 		/* Reject I/O not on sector boundary */
 		if (bp->bio_offset % pp->sectorsize)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004221224.o3MCOxcW075378>