[Bug 211028] [GEOM][Hyper-V] gpart can't detect the new free space after the disk capacity changes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jul 15 13:36:30 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211028

--- Comment #15 from Dexuan Cui <decui at microsoft.com> ---
Hi all,
I know why g_disk_resize() can't work here when I open da1 for reading after a
disk capacity change:

When /dev/da1 is opened for reading (or writing) every time, amd64_syscall() ->
kern_openat() -> ... -> g_dev_open() -> g_access() -> g_disk_access() ->
daopen() -> dareprobe() sends the DA_STATE_PROBE_RC16 command; if the disk
capacity was changed, in g_disk_access(), we update provide's mediasize
***immediately***: pp->mediasize = dp->d_mediasize;

Later, in disk_resize(), g_disk_resize() -> g_resize_provider(): because of
disk's size == pp->mediasize, g_resize_provider() doesn't post the
g_resize_provider_event event at all. This is why "camcontrol reprobe da1"
can't help.

BTW, opening da1 for writing can work because the provider is destroyed and
re-created, as you mentioned.

I'll be proposing a patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list