From owner-svn-src-stable@FreeBSD.ORG Fri Dec 13 20:33:59 2013 Return-Path: Delivered-To: svn-src-stable@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 ESMTPS id EBC91D77; Fri, 13 Dec 2013 20:33:59 +0000 (UTC) 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 BDBD3198A; Fri, 13 Dec 2013 20:33:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDKXxZS011031; Fri, 13 Dec 2013 20:33:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDKXx00011029; Fri, 13 Dec 2013 20:33:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312132033.rBDKXx00011029@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 20:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259328 - in stable/10/sys/geom: . label X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:34:00 -0000 Author: trasz Date: Fri Dec 13 20:33:59 2013 New Revision: 259328 URL: http://svnweb.freebsd.org/changeset/base/259328 Log: MFC r256724: Make geom_label(4) resize-aware. This fixes a situation when "gpart resize" would resize a partition, but label providers - e.g. /dev/gptid/XXX - would stay the same size. MFC r256766: Fix build with gcc by spelling unused format string as "unused" instead of NULL. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/geom/geom_slice.c stable/10/sys/geom/label/g_label.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_slice.c ============================================================================== --- stable/10/sys/geom/geom_slice.c Fri Dec 13 19:38:05 2013 (r259327) +++ stable/10/sys/geom/geom_slice.c Fri Dec 13 20:33:59 2013 (r259328) @@ -382,7 +382,7 @@ g_slice_config(struct g_geom *gp, u_int printf("GEOM: Reconfigure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, (intmax_t)(offset + length - 1)); - pp->mediasize = gsl->length; + g_resize_provider(pp, gsl->length); return (0); } sb = sbuf_new_auto(); Modified: stable/10/sys/geom/label/g_label.c ============================================================================== --- stable/10/sys/geom/label/g_label.c Fri Dec 13 19:38:05 2013 (r259327) +++ stable/10/sys/geom/label/g_label.c Fri Dec 13 20:33:59 2013 (r259328) @@ -124,6 +124,17 @@ g_label_spoiled(struct g_consumer *cp) g_slice_spoiled(cp); } +static void +g_label_resize(struct g_consumer *cp) +{ + + G_LABEL_DEBUG(1, "Label %s resized.", + LIST_FIRST(&cp->geom->provider)->name); + + g_slice_config(cp->geom, 0, G_SLICE_CONFIG_FORCE, (off_t)0, + cp->provider->mediasize, cp->provider->sectorsize, "notused"); +} + static int g_label_is_name_ok(const char *label) { @@ -208,6 +219,7 @@ g_label_create(struct gctl_req *req, str } gp->orphan = g_label_orphan; gp->spoiled = g_label_spoiled; + gp->resize = g_label_resize; g_access(cp, -1, 0, 0); g_slice_config(gp, 0, G_SLICE_CONFIG_SET, (off_t)0, mediasize, pp->sectorsize, "%s", name);