summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEtienne Dechamps <[email protected]>2012-07-11 15:06:32 +0200
committerBrian Behlendorf <[email protected]>2012-07-17 09:17:31 -0700
commitb5a28807cdec3c05aa69cbe4689cd914dc94783a (patch)
tree74d6949d5c6c27dbb5db9f3f3c23bffb81a75cfb /scripts
parentfb7eb3e3e9f8e611a34192ceb5c2d2e849ca6de8 (diff)
Move partition scanning from userspace to module.
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 <[email protected]> Closes #808
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.in2
-rw-r--r--scripts/zpios-profile/Makefile.in2
-rw-r--r--scripts/zpios-test/Makefile.in2
-rw-r--r--scripts/zpool-config/Makefile.in2
-rw-r--r--scripts/zpool-layout/Makefile.in2
5 files changed, 10 insertions, 0 deletions
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index ff7c33ee2..053ab806f 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-blk-rq-pos.m4 \
$(top_srcdir)/config/kernel-blk-rq-sectors.m4 \
$(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+ $(top_srcdir)/config/kernel-blkdev-get.m4 \
$(top_srcdir)/config/kernel-check-disk-size-change.m4 \
$(top_srcdir)/config/kernel-create-umode-t.m4 \
$(top_srcdir)/config/kernel-d-make-root.m4 \
@@ -72,6 +73,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-fmode-t.m4 \
$(top_srcdir)/config/kernel-fsync.m4 \
$(top_srcdir)/config/kernel-get-disk-ro.m4 \
+ $(top_srcdir)/config/kernel-get-gendisk.m4 \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in
index 9f69032fe..fb54f2aec 100644
--- a/scripts/zpios-profile/Makefile.in
+++ b/scripts/zpios-profile/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-blk-rq-pos.m4 \
$(top_srcdir)/config/kernel-blk-rq-sectors.m4 \
$(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+ $(top_srcdir)/config/kernel-blkdev-get.m4 \
$(top_srcdir)/config/kernel-check-disk-size-change.m4 \
$(top_srcdir)/config/kernel-create-umode-t.m4 \
$(top_srcdir)/config/kernel-d-make-root.m4 \
@@ -72,6 +73,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-fmode-t.m4 \
$(top_srcdir)/config/kernel-fsync.m4 \
$(top_srcdir)/config/kernel-get-disk-ro.m4 \
+ $(top_srcdir)/config/kernel-get-gendisk.m4 \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in
index a83ba7ef7..8797779be 100644
--- a/scripts/zpios-test/Makefile.in
+++ b/scripts/zpios-test/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-blk-rq-pos.m4 \
$(top_srcdir)/config/kernel-blk-rq-sectors.m4 \
$(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+ $(top_srcdir)/config/kernel-blkdev-get.m4 \
$(top_srcdir)/config/kernel-check-disk-size-change.m4 \
$(top_srcdir)/config/kernel-create-umode-t.m4 \
$(top_srcdir)/config/kernel-d-make-root.m4 \
@@ -72,6 +73,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-fmode-t.m4 \
$(top_srcdir)/config/kernel-fsync.m4 \
$(top_srcdir)/config/kernel-get-disk-ro.m4 \
+ $(top_srcdir)/config/kernel-get-gendisk.m4 \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in
index ccd79c8b3..b4e1c9fd3 100644
--- a/scripts/zpool-config/Makefile.in
+++ b/scripts/zpool-config/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-blk-rq-pos.m4 \
$(top_srcdir)/config/kernel-blk-rq-sectors.m4 \
$(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+ $(top_srcdir)/config/kernel-blkdev-get.m4 \
$(top_srcdir)/config/kernel-check-disk-size-change.m4 \
$(top_srcdir)/config/kernel-create-umode-t.m4 \
$(top_srcdir)/config/kernel-d-make-root.m4 \
@@ -72,6 +73,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-fmode-t.m4 \
$(top_srcdir)/config/kernel-fsync.m4 \
$(top_srcdir)/config/kernel-get-disk-ro.m4 \
+ $(top_srcdir)/config/kernel-get-gendisk.m4 \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \
diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in
index 373e17ff4..f6dc9321e 100644
--- a/scripts/zpool-layout/Makefile.in
+++ b/scripts/zpool-layout/Makefile.in
@@ -63,6 +63,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-blk-rq-pos.m4 \
$(top_srcdir)/config/kernel-blk-rq-sectors.m4 \
$(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+ $(top_srcdir)/config/kernel-blkdev-get.m4 \
$(top_srcdir)/config/kernel-check-disk-size-change.m4 \
$(top_srcdir)/config/kernel-create-umode-t.m4 \
$(top_srcdir)/config/kernel-d-make-root.m4 \
@@ -72,6 +73,7 @@ am__aclocal_m4_deps = \
$(top_srcdir)/config/kernel-fmode-t.m4 \
$(top_srcdir)/config/kernel-fsync.m4 \
$(top_srcdir)/config/kernel-get-disk-ro.m4 \
+ $(top_srcdir)/config/kernel-get-gendisk.m4 \
$(top_srcdir)/config/kernel-insert-inode-locked.m4 \
$(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
$(top_srcdir)/config/kernel-kobj-name-len.m4 \