aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2016-07-19 05:36:21 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2016-07-19 05:36:21 +0000
commitf1ff88cf8c37c0224c940c822f486de9229880a0 (patch)
tree7cc1f35bf6860e22865c960313a5f3d111f6cf01 /sys/geom
parented22e564b81751f00be9419c5bd0c0c5e4531ab7 (diff)
downloadsrc-f1ff88cf8c37c0224c940c822f486de9229880a0.tar.gz
src-f1ff88cf8c37c0224c940c822f486de9229880a0.zip
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 <decui at microsoft dot com> MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=303019
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index e4b1e141b541..6566aafac2cc 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -126,7 +126,6 @@ g_disk_access(struct g_provider *pp, int r, int w, int e)
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 r, int w, int e)
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);