summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/geom/part/g_part_mbr.c4
-rw-r--r--sys/geom/part/g_part_pc98.c2
-rw-r--r--sys/geom/part/g_part_vtoc8.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c
index f9f06be..73101ff 100644
--- a/sys/geom/part/g_part_mbr.c
+++ b/sys/geom/part/g_part_mbr.c
@@ -356,8 +356,8 @@ g_part_mbr_resize(struct g_part_table *basetable,
return (EINVAL);
/* XXX: prevent unexpected shrinking. */
pp = baseentry->gpe_pp;
- if ((g_debugflags & 16) == 0 && size < gpp->gpp_size &&
- (pp->acr > 0 || pp->acw > 0 || pp->ace > 0))
+ if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size &&
+ pp->mediasize / pp->sectorsize > size)
return (EBUSY);
entry = (struct g_part_mbr_entry *)baseentry;
baseentry->gpe_end = baseentry->gpe_start + size - 1;
diff --git a/sys/geom/part/g_part_pc98.c b/sys/geom/part/g_part_pc98.c
index b2b6e68..07d6a62 100644
--- a/sys/geom/part/g_part_pc98.c
+++ b/sys/geom/part/g_part_pc98.c
@@ -364,7 +364,7 @@ g_part_pc98_resize(struct g_part_table *basetable,
/* XXX: prevent unexpected shrinking. */
pp = baseentry->gpe_pp;
if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size &&
- (pp->acr > 0 || pp->acw > 0 || pp->ace > 0))
+ pp->mediasize / pp->sectorsize > size)
return (EBUSY);
entry = (struct g_part_pc98_entry *)baseentry;
baseentry->gpe_end = baseentry->gpe_start + size - 1;
diff --git a/sys/geom/part/g_part_vtoc8.c b/sys/geom/part/g_part_vtoc8.c
index 04d90cb..514e3f7 100644
--- a/sys/geom/part/g_part_vtoc8.c
+++ b/sys/geom/part/g_part_vtoc8.c
@@ -371,7 +371,7 @@ g_part_vtoc8_resize(struct g_part_table *basetable,
/* XXX: prevent unexpected shrinking. */
pp = entry->gpe_pp;
if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size &&
- (pp->acr > 0 || pp->acw > 0 || pp->ace > 0))
+ pp->mediasize / pp->sectorsize > size)
return (EBUSY);
entry->gpe_end = entry->gpe_start + size - 1;
be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size);
OpenPOWER on IntegriCloud