Add sysctl to control auto resize of the GEOM metadata.
Reviewed by: AllanJude Differential Revision: https://reviews.freebsd.org/D9603
This commit is contained in:
parent
64e574c22d
commit
01ad653a81
@ -1146,6 +1146,18 @@ variables can be used to control the behavior of the
|
||||
GEOM class.
|
||||
The default value is shown next to each variable.
|
||||
.Bl -tag -width indent
|
||||
.It Va kern.geom.part.auto_resize: No 1
|
||||
This variable controls automatic resize behavior of
|
||||
.Nm
|
||||
GEOM class.
|
||||
When this variable is enable and new size of provider is detected, the schema
|
||||
metadata is resized but all changes are not saved to disk, until
|
||||
.Cm gpart commit
|
||||
is run to confirm changes.
|
||||
This behavior is also reported with diagnostic message:
|
||||
.Sy "GEOM_PART: (provider) was automatically resized."
|
||||
.Sy "Use `gpart commit (provider)` to save changes or `gpart undo (provider)`"
|
||||
.Sy "to revert them."
|
||||
.It Va kern.geom.part.check_integrity : No 1
|
||||
This variable controls the behaviour of metadata integrity checks.
|
||||
When integrity checks are enabled, the
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user