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

--- Comment #15 from Dexuan Cui <de...@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.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to