From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:46:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6942AF88; Wed, 3 Jul 2013 23:46:31 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 420D61F0B; Wed, 3 Jul 2013 23:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NkVX7066375; Wed, 3 Jul 2013 23:46:31 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NkUnc066372; Wed, 3 Jul 2013 23:46:30 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307032346.r63NkUnc066372@svn.freebsd.org> From: Steven Hartland Date: Wed, 3 Jul 2013 23:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252657 - in head/sys: cam/scsi 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: Wed, 03 Jul 2013 23:46:31 -0000 Author: smh Date: Wed Jul 3 23:46:30 2013 New Revision: 252657 URL: http://svnweb.freebsd.org/changeset/base/252657 Log: Bump disk(9) ABI version to signify the addition of d_delmaxsize by r249940. Ensure that d_delmaxsize is always set, removing init to 0 which could cause future issues if use cases change. Allow kern.cam.da.X.delete_max (which maps to d_delmaxsize) to be increased up to the calculated max after being reduced. MFC after: 1 day X-MFC-With: r249940 Modified: head/sys/cam/scsi/scsi_da.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jul 3 23:45:58 2013 (r252656) +++ head/sys/cam/scsi/scsi_da.c Wed Jul 3 23:46:30 2013 (r252657) @@ -1746,7 +1746,7 @@ dadeletemaxsysctl(SYSCTL_HANDLER_ARGS) return (error); /* only accept values smaller than the calculated value */ - if (value > softc->disk->d_delmaxsize) { + if (value > dadeletemaxsize(softc, softc->delete_method)) { return (EINVAL); } softc->disk->d_delmaxsize = value; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Jul 3 23:45:58 2013 (r252656) +++ head/sys/geom/geom_disk.c Wed Jul 3 23:46:30 2013 (r252657) @@ -148,14 +148,12 @@ g_disk_access(struct g_provider *pp, int dp->d_name, dp->d_unit); dp->d_maxsize = DFLTPHYS; } - if (dp->d_flags & DISKFLAG_CANDELETE) { - if (bootverbose && dp->d_delmaxsize == 0) { - printf("WARNING: Disk drive %s%d has no d_delmaxsize\n", - dp->d_name, dp->d_unit); - dp->d_delmaxsize = dp->d_maxsize; + if (dp->d_delmaxsize == 0) { + if (bootverbose && dp->d_flags & DISKFLAG_CANDELETE) { + printf("WARNING: Disk drive %s%d has no " + "d_delmaxsize\n", dp->d_name, dp->d_unit); } - } else { - dp->d_delmaxsize = 0; + dp->d_delmaxsize = dp->d_maxsize; } pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; @@ -629,7 +627,7 @@ void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_02) { + if (version != DISK_VERSION) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Wed Jul 3 23:45:58 2013 (r252656) +++ head/sys/geom/geom_disk.h Wed Jul 3 23:46:30 2013 (r252657) @@ -120,7 +120,8 @@ int disk_resize(struct disk *dp, int fla #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a #define DISK_VERSION_02 0x5856105b -#define DISK_VERSION DISK_VERSION_02 +#define DISK_VERSION_03 0x5856105c +#define DISK_VERSION DISK_VERSION_03 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */