diff options
49 files changed, 241 insertions, 10 deletions
diff --git a/Makefile.in b/Makefile.in index e3a7bc64b..250248249 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/Makefile.in b/cmd/Makefile.in index f8664363c..f8f5a7697 100644 --- a/cmd/Makefile.in +++ b/cmd/Makefile.in @@ -42,6 +42,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in index a34342f79..88152b846 100644 --- a/cmd/zdb/Makefile.in +++ b/cmd/zdb/Makefile.in @@ -45,6 +45,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in index fd80e2dbe..dd44b2684 100644 --- a/cmd/zfs/Makefile.in +++ b/cmd/zfs/Makefile.in @@ -45,6 +45,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in index 265b944f3..ddf61bce9 100644 --- a/cmd/zinject/Makefile.in +++ b/cmd/zinject/Makefile.in @@ -45,6 +45,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in index f2ee687fc..911f9c338 100644 --- a/cmd/zpios/Makefile.in +++ b/cmd/zpios/Makefile.in @@ -45,6 +45,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in index 94761f6d8..258de649b 100644 --- a/cmd/zpool/Makefile.in +++ b/cmd/zpool/Makefile.in @@ -45,6 +45,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in index d991a00f7..6d2fd50e4 100644 --- a/cmd/zpool_id/Makefile.in +++ b/cmd/zpool_id/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in index 0b0e00c5f..ea8947cbc 100644 --- a/cmd/zpool_layout/Makefile.in +++ b/cmd/zpool_layout/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in index a70d055e3..c102d0292 100644 --- a/cmd/ztest/Makefile.in +++ b/cmd/ztest/Makefile.in @@ -45,6 +45,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/config/kernel-bio-failfast.m4 b/config/kernel-bio-failfast.m4 new file mode 100644 index 000000000..acc657562 --- /dev/null +++ b/config/kernel-bio-failfast.m4 @@ -0,0 +1,22 @@ +dnl # +dnl # 2.6.28 API change +dnl # Device, transport, and driver FAILFAST flags were added and +dnl # the now legacy BIO_RW_FAILFAST flag was removed. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST], [ + AC_MSG_CHECKING([whether BIO_RW_FAILFAST_* are defined]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/bio.h> + ],[ + int flags; + flags = ((1 << BIO_RW_FAILFAST_DEV) | + (1 << BIO_RW_FAILFAST_TRANSPORT) | + (1 << BIO_RW_FAILFAST_DRIVER)); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BIO_RW_FAILFAST, 1, + [BIO_RW_FAILFAST_* are defined]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 193aae113..517af39f7 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -12,6 +12,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE ZFS_AC_KERNEL_BIO_EMPTY_BARRIER + ZFS_AC_KERNEL_BIO_FAILFAST ZFS_AC_KERNEL_BIO_END_IO_T_ARGS ZFS_AC_KERNEL_BIO_RW_SYNCIO ZFS_AC_KERNEL_BLK_END_REQUEST @@ -12613,6 +12613,74 @@ fi + { $as_echo "$as_me:$LINENO: checking whether BIO_RW_FAILFAST_* are defined" >&5 +$as_echo_n "checking whether BIO_RW_FAILFAST_* are defined... " >&6; } + + +cat confdefs.h - <<_ACEOF >conftest.c +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include <linux/bio.h> + +int +main (void) +{ + + int flags; + flags = ((1 << BIO_RW_FAILFAST_DEV) | + (1 << BIO_RW_FAILFAST_TRANSPORT) | + (1 << BIO_RW_FAILFAST_DRIVER)); + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BIO_RW_FAILFAST 1 +_ACEOF + + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + + +fi + + rm -Rf build + + + + { $as_echo "$as_me:$LINENO: checking whether bio_end_io_t wants 2 args" >&5 $as_echo_n "checking whether bio_end_io_t wants 2 args... " >&6; } tmp_flags="$EXTRA_KCFLAGS" @@ -15616,6 +15684,74 @@ fi + { $as_echo "$as_me:$LINENO: checking whether BIO_RW_FAILFAST_* are defined" >&5 +$as_echo_n "checking whether BIO_RW_FAILFAST_* are defined... " >&6; } + + +cat confdefs.h - <<_ACEOF >conftest.c +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include <linux/bio.h> + +int +main (void) +{ + + int flags; + flags = ((1 << BIO_RW_FAILFAST_DEV) | + (1 << BIO_RW_FAILFAST_TRANSPORT) | + (1 << BIO_RW_FAILFAST_DRIVER)); + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BIO_RW_FAILFAST 1 +_ACEOF + + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + + +fi + + rm -Rf build + + + + { $as_echo "$as_me:$LINENO: checking whether bio_end_io_t wants 2 args" >&5 $as_echo_n "checking whether bio_end_io_t wants 2 args... " >&6; } tmp_flags="$EXTRA_KCFLAGS" diff --git a/etc/Makefile.in b/etc/Makefile.in index f5835b395..5eb555171 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/include/Makefile.in b/include/Makefile.in index 6c351a868..6821a67fe 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in index bcadd908a..8964aae41 100644 --- a/include/sys/Makefile.in +++ b/include/sys/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/include/sys/blkdev.h b/include/sys/blkdev.h index b84f66aed..7102890f1 100644 --- a/include/sys/blkdev.h +++ b/include/sys/blkdev.h @@ -202,6 +202,38 @@ struct req_iterator { bio_for_each_segment(bvl, _iter.bio, _iter.i) #endif /* HAVE_RQ_FOR_EACH_SEGMENT */ +static inline void +bio_set_flags_failfast(struct block_device *bdev, int *flags) +{ +#ifdef HAVE_BIO_RW_FAILFAST + /* + * Disable BIO_RW_FAILFAST_* for loopback devices because of + * the following incorrect BUG_ON() in loop_make_request(). + * This support is also disabled for md devices because the + * test suite layers md devices on top of loopback devices. + * This may be removed when the loopback driver is fixed. + * + * BUG_ON(!lo || (rw != READ && rw != WRITE)); + */ +#ifdef CONFIG_BUG + if ((MAJOR(bdev->bd_dev) == LOOP_MAJOR) || + (MAJOR(bdev->bd_dev) == MD_MAJOR)) + return; + +#ifdef BLOCK_EXT_MAJOR + if (MAJOR(bdev->bd_dev) == BLOCK_EXT_MAJOR) + return; +#endif /* BLOCK_EXT_MAJOR */ +#endif /* CONFIG_BUG */ + *flags |= + ((1 << BIO_RW_FAILFAST_DEV) | + (1 << BIO_RW_FAILFAST_TRANSPORT) | + (1 << BIO_RW_FAILFAST_DRIVER)); +#else /* !HAVE_BIO_RW_FAILFAST */ + *flags |= (1 << BIO_RW_FAILFAST); +#endif /* HAVE_BIO_RW_FAILFAST */ +} + #ifndef DISK_NAME_LEN #define DISK_NAME_LEN 32 #endif /* DISK_NAME_LEN */ diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in index 0cfa33043..5e1f4b883 100644 --- a/include/sys/fm/Makefile.in +++ b/include/sys/fm/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in index 4a31d6580..ed828ebdd 100644 --- a/include/sys/fm/fs/Makefile.in +++ b/include/sys/fm/fs/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in index 25c170cc7..3103ffa67 100644 --- a/include/sys/fs/Makefile.in +++ b/include/sys/fs/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/Makefile.in b/lib/Makefile.in index dc4c9a680..9749b774a 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -42,6 +42,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index 454be6a67..930f8e580 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index debd06fd8..294cac074 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 27873bd1b..8f689d4d8 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index c2f3bc665..6bf147834 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index 632910f18..8b87c314b 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index 281f36599..fe9d9cb4f 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index 51689b6cb..750690300 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index ec0dd912c..1a0a7f8b1 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index 4c39db696..4b97ee1b4 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -42,6 +42,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index 2cf46c908..1b2fb35ee 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index 5c946ee67..f5385d9d1 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index 28fa39110..cb930aacf 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index 02b107e99..713aa88b6 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index 71cb626ed..858e38877 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index 07cdb7835..1cdbb5740 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index 035a243c3..1f431dad3 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index 34a1248a4..e600ba49f 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index f41504ecd..741f39da4 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index 5eb528b71..99ad7199c 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -44,6 +44,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/man/Makefile.in b/man/Makefile.in index 04390d9e6..c18b275c0 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -42,6 +42,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in index ee5678ccf..8cace2c04 100644 --- a/man/man8/Makefile.in +++ b/man/man8/Makefile.in @@ -42,6 +42,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index 9ae8fbc18..863392544 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -342,15 +342,13 @@ retry: if (dr == NULL) return ENOMEM; + if (zio && !(zio->io_flags & (ZIO_FLAG_IO_RETRY | ZIO_FLAG_TRYHARD))) + bio_set_flags_failfast(bdev, &flags); + dr->dr_zio = zio; dr->dr_rw = flags; block_size = vdev_bdev_block_size(bdev); -#ifdef BIO_RW_FAILFAST - if (flags & (1 << BIO_RW_FAILFAST)) - dr->dr_rw |= 1 << BIO_RW_FAILFAST; -#endif /* BIO_RW_FAILFAST */ - /* * When the IO size exceeds the maximum bio size for the request * queue we are forced to break the IO in multiple bio's and wait @@ -434,6 +432,7 @@ int vdev_disk_physio(struct block_device *bdev, caddr_t kbuf, size_t size, uint64_t offset, int flags) { + bio_set_flags_failfast(bdev, &flags); return __vdev_disk_physio(bdev, NULL, kbuf, size, offset, flags); } @@ -540,11 +539,6 @@ vdev_disk_io_start(zio_t *zio) return ZIO_PIPELINE_CONTINUE; } -#ifdef BIO_RW_FAILFAST - if (zio->io_flags & (ZIO_FLAG_IO_RETRY | ZIO_FLAG_TRYHARD)) - flags |= (1 << BIO_RW_FAILFAST); -#endif /* BIO_RW_FAILFAST */ - error = __vdev_disk_physio(vd->vd_bdev, zio, zio->io_data, zio->io_size, zio->io_offset, flags); if (error) { diff --git a/scripts/Makefile.in b/scripts/Makefile.in index cd9971b0a..2a1a4509e 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in index d9ab1b20d..1aa13065f 100644 --- a/scripts/zpios-profile/Makefile.in +++ b/scripts/zpios-profile/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in index 7ff309b98..4101feb85 100644 --- a/scripts/zpios-test/Makefile.in +++ b/scripts/zpios-test/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in index 996d15cdd..a312c948c 100644 --- a/scripts/zpool-config/Makefile.in +++ b/scripts/zpool-config/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in index 7623e4685..baa20881a 100644 --- a/scripts/zpool-layout/Makefile.in +++ b/scripts/zpool-layout/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ + $(top_srcdir)/config/kernel-bio-failfast.m4 \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ diff --git a/zfs_config.h.in b/zfs_config.h.in index ef8b4f9a6..4797a9baf 100644 --- a/zfs_config.h.in +++ b/zfs_config.h.in @@ -15,6 +15,9 @@ /* bio_empy_barrier() is defined */ #undef HAVE_BIO_EMPTY_BARRIER +/* BIO_RW_FAILFAST_* are defined */ +#undef HAVE_BIO_RW_FAILFAST + /* BIO_RW_SYNCIO is defined */ #undef HAVE_BIO_RW_SYNCIO |