From owner-svn-src-all@FreeBSD.ORG Fri Oct 25 19:19:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2C0B5BF0; Fri, 25 Oct 2013 19:19:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1888B2BD1; Fri, 25 Oct 2013 19:19:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9PJJCuX094913; Fri, 25 Oct 2013 19:19:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9PJJCwD094911; Fri, 25 Oct 2013 19:19:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310251919.r9PJJCwD094911@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Oct 2013 19:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257131 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 19:19:13 -0000 Author: jhb Date: Fri Oct 25 19:19:12 2013 New Revision: 257131 URL: http://svnweb.freebsd.org/changeset/base/257131 Log: Reject attempts to attack a disk device that has the old NEEDSGIANT flag set. Reviewed by: mav Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Fri Oct 25 19:15:21 2013 (r257130) +++ head/sys/geom/geom_disk.c Fri Oct 25 19:19:12 2013 (r257131) @@ -657,6 +657,13 @@ disk_create(struct disk *dp, int version dp->d_name, dp->d_unit); return; } + if (dp->d_flags & DISKFLAG_RESERVED) { + printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n", + dp->d_name, dp->d_unit); + printf("WARNING: Ignoring disk %s%d\n", + dp->d_name, dp->d_unit); + return; + } KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); KASSERT(dp->d_name != NULL, ("disk_create need d_name")); KASSERT(*dp->d_name != 0, ("disk_create need d_name")); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Fri Oct 25 19:15:21 2013 (r257130) +++ head/sys/geom/geom_disk.h Fri Oct 25 19:19:12 2013 (r257131) @@ -103,6 +103,7 @@ struct disk { void *d_drv1; }; +#define DISKFLAG_RESERVED 0x1 /* Was NEEDSGIANT */ #define DISKFLAG_OPEN 0x2 #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8