aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2017-02-27 17:54:01 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2017-02-27 17:54:01 +0000
commit01ad653a81aa7918a86d0ddadaa73269d9726a32 (patch)
treeeba3572ef0294dd95194be92153dc0a0c31b9827 /sys/geom
parent64e574c22d3a9ea3388c492fe2832d92cc7234cd (diff)
downloadsrc-01ad653a81aa7918a86d0ddadaa73269d9726a32.tar.gz
src-01ad653a81aa7918a86d0ddadaa73269d9726a32.zip
Add sysctl to control auto resize of the GEOM metadata.
Reviewed by: AllanJude Differential Revision: https://reviews.freebsd.org/D9603
Notes
Notes: svn path=/head/; revision=314359
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/part/g_part.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 4f52398ca0b9..a868121c00f0 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -135,6 +135,10 @@ static u_int check_integrity = 1;
SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity,
CTLFLAG_RWTUN, &check_integrity, 1,
"Enable integrity checking");
+static u_int auto_resize = 1;
+SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize,
+ CTLFLAG_RW, &auto_resize, 1,
+ "Enable auto resize");
/*
* The GEOM partitioning class.
@@ -2095,6 +2099,9 @@ g_part_resize(struct g_consumer *cp)
G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->name));
g_topology_assert();
+ if (auto_resize == 0)
+ return;
+
table = cp->geom->softc;
if (table->gpt_opened == 0) {
if (g_access(cp, 1, 1, 1) != 0)