mirror_zfs/lib/libzfs/os/linux
George Wilson dacb4f6a61 pool may become suspended during device expansion
When expanding a device zfs needs to rescan the partition table to
get the correct size. This can only happen when we're in the kernel
and requires the device to be closed. As part of the rescan, udev is
notified and the device links are removed and recreated. This leave a
window where the vdev code may try to reopen the device before udev
has recreated the link. If that happens, then the pool may end up in
a suspended state.

To correct this, we leverage the BLKPG_RESIZE_PARTITION ioctl which
allows the partition information to be modified even while it's in use.
This ioctl also does not remove the device link associated with the zfs
data partition so it eliminates the race condition that can occur in
the kernel.

Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #10897
2020-09-18 12:38:30 -07:00
..
libzfs_mount_os.c Remove dependency on sharetab file and refactor sharing logic 2020-07-13 09:19:18 -07:00
libzfs_pool_os.c pool may become suspended during device expansion 2020-09-18 12:38:30 -07:00
libzfs_sendrecv_os.c OpenZFS restructuring - libzfs 2019-10-03 10:33:16 -07:00
libzfs_util_os.c Move zfs_version_kernel to platform code 2020-02-12 13:00:19 -08:00