Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jan 2011 05:13:40 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@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: r217572 - in stable/8: sbin/geom/class/raid3 sbin/geom/class/sched sys/geom/raid3
Message-ID:  <201101190513.p0J5De2D064261@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Jan 19 05:13:40 2011
New Revision: 217572
URL: http://svn.freebsd.org/changeset/base/217572

Log:
  MFC r217305:
    Sector size can not be greater than MAXPHYS. Since GRAID3 calculates
    sector size from user-specified block size, report to user about
    big blocksize.
  
    PR:		kern/147851

Modified:
  stable/8/sbin/geom/class/raid3/geom_raid3.c
  stable/8/sys/geom/raid3/g_raid3.c
Directory Properties:
  stable/8/sbin/geom/   (props changed)
  stable/8/sbin/geom/class/multipath/   (props changed)
  stable/8/sbin/geom/class/part/   (props changed)
  stable/8/sbin/geom/class/sched/gsched.8   (props changed)
  stable/8/sbin/geom/class/stripe/   (props changed)
  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)

Modified: stable/8/sbin/geom/class/raid3/geom_raid3.c
==============================================================================
--- stable/8/sbin/geom/class/raid3/geom_raid3.c	Wed Jan 19 05:08:32 2011	(r217571)
+++ stable/8/sbin/geom/class/raid3/geom_raid3.c	Wed Jan 19 05:13:40 2011	(r217572)
@@ -212,6 +212,11 @@ raid3_label(struct gctl_req *req)
 	md.md_sectorsize = sectorsize * (nargs - 2);
 	md.md_mediasize -= (md.md_mediasize % md.md_sectorsize);
 
+	if (md.md_sectorsize > MAXPHYS) {
+		gctl_error(req, "The blocksize is too big.");
+		return;
+	}
+
 	/*
 	 * Clear last sector first, to spoil all components if device exists.
 	 */

Modified: stable/8/sys/geom/raid3/g_raid3.c
==============================================================================
--- stable/8/sys/geom/raid3/g_raid3.c	Wed Jan 19 05:08:32 2011	(r217571)
+++ stable/8/sys/geom/raid3/g_raid3.c	Wed Jan 19 05:13:40 2011	(r217572)
@@ -2913,6 +2913,10 @@ g_raid3_read_metadata(struct g_consumer 
 		    cp->provider->name);
 		return (error);
 	}
+	if (md->md_sectorsize > MAXPHYS) {
+		G_RAID3_DEBUG(0, "The blocksize is too big.");
+		return (EINVAL);
+	}
 
 	return (0);
 }



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