b5a28807cd
Currently, zpool online -e (dynamic vdev expansion) doesn't work on whole disks because we're invoking ioctl(BLKRRPART) from userspace while ZFS still has a partition open on the disk, which results in EBUSY. This patch moves the BLKRRPART invocation from the zpool utility to the module. Specifically, this is done just before opening the device in vdev_disk_open() which is called inside vdev_reopen(). This requires jumping through some hoops to get to the disk device from the partition device, and to make sure we can still open the partition after the BLKRRPART call. Note that this new code path is triggered on dynamic vdev expansion only; other actions, like creating a new pool, are unchanged and still call BLKRRPART from userspace. This change also depends on API changes which are available in 2.6.37 and latter kernels. The build system has been updated to detect this, but there is no compatibility mode for older kernels. This means that online expansion will NOT be available in older kernels. However, it will still be possible to expand the vdev offline. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #808
12 lines
264 B
Plaintext
12 lines
264 B
Plaintext
dnl #
|
|
dnl # 2.6.34 API change
|
|
dnl # Verify the get_gendisk() symbol is exported.
|
|
dnl #
|
|
AC_DEFUN([ZFS_AC_KERNEL_GET_GENDISK], [
|
|
ZFS_CHECK_SYMBOL_EXPORT(
|
|
[get_gendisk],
|
|
[block/genhd.c],
|
|
[AC_DEFINE(HAVE_GET_GENDISK, 1, [get_gendisk() is available])],
|
|
[])
|
|
])
|