aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/os/linux
diff options
context:
space:
mode:
authorGeorge Wilson <[email protected]>2020-09-17 22:03:10 -0500
committerGitHub <[email protected]>2020-09-17 20:03:10 -0700
commit8e82ffba7be213373eb7805cadfb6fe3260f0cdd (patch)
treeed98ca1757820497eb23cd41cc00577357dda7b1 /lib/libzfs/os/linux
parenta57f954226ce1111a022d1fa615e555c5e735a35 (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Wilson <[email protected]> Closes #10897
Diffstat (limited to 'lib/libzfs/os/linux')
-rw-r--r--lib/libzfs/os/linux/libzfs_pool_os.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/libzfs/os/linux/libzfs_pool_os.c b/lib/libzfs/os/linux/libzfs_pool_os.c
index 5c6da5338..e4f03aa43 100644
--- a/lib/libzfs/os/linux/libzfs_pool_os.c
+++ b/lib/libzfs/os/linux/libzfs_pool_os.c
@@ -72,9 +72,6 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg)
* It's possible that we might encounter an error if the device
* does not have any unallocated space left. If so, we simply
* ignore that error and continue on.
- *
- * Also, we don't call efi_rescan() - that would just return EBUSY.
- * The module will do it for us in vdev_disk_open().
*/
error = efi_use_whole_disk(fd);