From owner-svn-src-all@freebsd.org Tue Jul 19 05:36:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93096B9D160; Tue, 19 Jul 2016 05:36:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ECAC16D3; Tue, 19 Jul 2016 05:36:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6J5aL0O015269; Tue, 19 Jul 2016 05:36:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6J5aLl7015268; Tue, 19 Jul 2016 05:36:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201607190536.u6J5aLl7015268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 19 Jul 2016 05:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303019 - 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.22 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: Tue, 19 Jul 2016 05:36:22 -0000 Author: ae Date: Tue Jul 19 05:36:21 2016 New Revision: 303019 URL: https://svnweb.freebsd.org/changeset/base/303019 Log: Use g_resize_provider() to change the size of GEOM_DISK provider, when it is being opened. This should fix the possible loss of a resize event when disk capacity changed. PR: 211028 Reported by: Dexuan Cui MFC after: 3 weeks Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Jul 19 04:56:59 2016 (r303018) +++ head/sys/geom/geom_disk.c Tue Jul 19 05:36:21 2016 (r303019) @@ -126,7 +126,6 @@ g_disk_access(struct g_provider *pp, int if (error != 0) return (error); } - pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; if (dp->d_maxsize == 0) { printf("WARNING: Disk drive %s%d has no d_maxsize\n", @@ -143,6 +142,7 @@ g_disk_access(struct g_provider *pp, int pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; dp->d_flags |= DISKFLAG_OPEN; + g_resize_provider(pp, dp->d_mediasize); } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) { if (dp->d_close != NULL) { error = dp->d_close(dp);