]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Add FAILFAST support
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 1 Oct 2010 17:57:56 +0000 (10:57 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 12 Oct 2010 21:55:02 +0000 (14:55 -0700)
ZFS works best when it is notified as soon as possible when a device
failure occurs.  This allows it to immediately start any recovery
actions which may be needed.  In theory Linux supports a flag which
can be set on bio's called FAILFAST which provides this quick
notification by disabling the retry logic in the lower scsi layers.

That's the theory at least.  In practice is turns out that while the
flag exists you oddly have to set it with the BIO_RW_AHEAD flag.
And even when it's set it you may get retries in the low level
drivers decides that's the right behavior, or if you don't get the
right error codes reported to the scsi midlayer.

Unfortunately, without additional kernels patchs there's not much
which can be done to improve this.  Basically, this just means that
it may take 2-3 minutes before a ZFS is notified properly that a
device has failed.  This can be improved and I suspect I'll be
submitting patches upstream to handle this.

49 files changed:
Makefile.in
cmd/Makefile.in
cmd/zdb/Makefile.in
cmd/zfs/Makefile.in
cmd/zinject/Makefile.in
cmd/zpios/Makefile.in
cmd/zpool/Makefile.in
cmd/zpool_id/Makefile.in
cmd/zpool_layout/Makefile.in
cmd/ztest/Makefile.in
config/kernel-bio-failfast.m4 [new file with mode: 0644]
config/kernel.m4
configure
etc/Makefile.in
include/Makefile.in
include/sys/Makefile.in
include/sys/blkdev.h
include/sys/fm/Makefile.in
include/sys/fm/fs/Makefile.in
include/sys/fs/Makefile.in
lib/Makefile.in
lib/libavl/Makefile.in
lib/libefi/Makefile.in
lib/libnvpair/Makefile.in
lib/libspl/Makefile.in
lib/libspl/asm-generic/Makefile.in
lib/libspl/asm-i386/Makefile.in
lib/libspl/asm-x86_64/Makefile.in
lib/libspl/include/Makefile.in
lib/libspl/include/ia32/Makefile.in
lib/libspl/include/ia32/sys/Makefile.in
lib/libspl/include/rpc/Makefile.in
lib/libspl/include/sys/Makefile.in
lib/libspl/include/sys/dktp/Makefile.in
lib/libspl/include/sys/sysevent/Makefile.in
lib/libspl/include/util/Makefile.in
lib/libunicode/Makefile.in
lib/libuutil/Makefile.in
lib/libzfs/Makefile.in
lib/libzpool/Makefile.in
man/Makefile.in
man/man8/Makefile.in
module/zfs/vdev_disk.c
scripts/Makefile.in
scripts/zpios-profile/Makefile.in
scripts/zpios-test/Makefile.in
scripts/zpool-config/Makefile.in
scripts/zpool-layout/Makefile.in
zfs_config.h.in

index e3a7bc64b0ac58d3605364f2d605bdea33dec513..2502482498f2d9898241315b25f3da317a167f7c 100644 (file)
@@ -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 \
index f8664363c4751b9f5e2a0e51ded4910cb05ee314..f8f5a76973e4a8b0b1ed4f19745734cd706fef07 100644 (file)
@@ -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 \
index a34342f79ca8914fa9efaf2ac37850492ede8575..88152b846155cbab1348335f65bd83659b696ce8 100644 (file)
@@ -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 \
index fd80e2dbe0dabe5d2e0b8850522ce1026c3d4389..dd44b268438108b4e99335dd580c24aad120e55b 100644 (file)
@@ -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 \
index 265b944f359c605c4dfffe9f8c4384b5a1a126ed..ddf61bce9575e35ee735d5c93b4dafb64af26555 100644 (file)
@@ -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 \
index f2ee687fcd7e6d3b5e43112395a427ec225f963a..911f9c338afbec444a97b1c8758266bcb550f0d5 100644 (file)
@@ -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 \
index 94761f6d8a7ce489151e981ad848d7a631550ff5..258de649b0663c8ef64451e57fea269a006970b4 100644 (file)
@@ -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 \
index d991a00f761700159e9a1452c034a61c0bc3bd64..6d2fd50e424fde5d63251ee2b68bb2d73395429c 100644 (file)
@@ -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 \
index 0b0e00c5f82ce064296950ff7bef65b60a3b1a14..ea8947cbc36c49b5f2cbca0635297b49fb510fb0 100644 (file)
@@ -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 \
index a70d055e32a5b44632131d4864cde05de0c1b41c..c102d0292835eebd38c056c5e0d1e4707a2ee39d 100644 (file)
@@ -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 (file)
index 0000000..acc6575
--- /dev/null
@@ -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)
+       ])
+])
index 193aae11391ef8c5c73652ddfe5ff2a4000b3fac..517af39f7a1ff87be026b0b41b69d542c5ee131b 100644 (file)
@@ -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
index 7bb25aba68a09ae4567eba271299037647182894..328be6584bbb159665fa11f11c03fd64db04afd8 100755 (executable)
--- a/configure
+++ b/configure
 
 
 
+       { $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"
 
 
 
+       { $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"
index f5835b395afb25f5d5b810ef47063e92421fb707..5eb555171c8804697c66b6d0545abbc755048426 100644 (file)
@@ -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 \
index 6c351a868e37c552a33753633a61cfd719030ac1..6821a67fea9afdd6b6c60f5e52887bb07308b09f 100644 (file)
@@ -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 \
index bcadd908acb741b5534efe8a4bd496a1d7c09d9a..8964aae41dbf8b63c3a9c41337616c7f7dc64619 100644 (file)
@@ -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 \
index b84f66aed4cbadf71cfb6cde983b4674dffa431f..7102890f14da659228a151fda9ce6041924bfbe3 100644 (file)
@@ -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 */
index 0cfa330439c04873c58f844e7babf6b7d59cd070..5e1f4b88351d6a250ce8401551b0b40fc09905b2 100644 (file)
@@ -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 \
index 4a31d65806a4e1a924d18c0383f4c3c660990133..ed828ebdd4db21908eaba2cc74b14174415af1b2 100644 (file)
@@ -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 \
index 25c170cc71c102b1a4471658c43e0f094e5a20db..3103ffa67494ae861a792f4e3a15e218da984785 100644 (file)
@@ -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 \
index dc4c9a680c2b5c256225d5cb079a68881a024459..9749b774a1ff9eda8c576ee81c1655c478c57c39 100644 (file)
@@ -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 \
index 454be6a672acc40b782c48bb0235b79972ec14e8..930f8e580b47b9e489c809c837b69d222782b855 100644 (file)
@@ -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 \
index debd06fd8f3bc48a7cb3bac96f720fae1c3a4443..294cac0747aadf6138c9a9c962e79f85ed5d2071 100644 (file)
@@ -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 \
index 27873bd1bd72f0e6de174f59c98cb80364c64ff2..8f689d4d8e7b4708f8b297f7858f84f89c31c486 100644 (file)
@@ -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 \
index c2f3bc665992838ca7c290e4e46311459bf46edb..6bf147834eb82b1ecb747c7b2f2c883af5036819 100644 (file)
@@ -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 \
index 632910f182823cf849caef8ffa4683cbfe63a11f..8b87c314ba72ce4f508d12fd7c950c716b84796b 100644 (file)
@@ -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 \
index 281f365999471b8f34a48382cc6b6784d87bc449..fe9d9cb4ff26baa2428d462fcfa716b6ccd7f191 100644 (file)
@@ -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 \
index 51689b6cb1185b3213a8dcdae74a24984f8944fd..7506903008a642b3f5b7bc8386ae3a33ef0805a9 100644 (file)
@@ -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 \
index ec0dd912c3f9306205d83e967544aced2a939e08..1a0a7f8b19eabea48851616af0f9ec83bc2bc5f3 100644 (file)
@@ -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 \
index 4c39db696ce4d3e6c90735f81a5802df4160d8fa..4b97ee1b45c18fd6ec067982ff934f4ce2b160ed 100644 (file)
@@ -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 \
index 2cf46c908c73efc898650c53e0304813c03e6eb5..1b2fb35ee722e9739f2676bc87ed4e5094ed1818 100644 (file)
@@ -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 \
index 5c946ee67fe249c279fc679fe1299d3a99139374..f5385d9d103c02cc38c2eb456b13b5470bbb1410 100644 (file)
@@ -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 \
index 28fa39110c81c9554587f495c4403b64482c2a83..cb930aacf6f8930fb15094adaed6f19eb491f376 100644 (file)
@@ -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 \
index 02b107e9986fd90543fe13ba1530b682a6bc95b2..713aa88b685889b8d86a79e03cf759425a3685d5 100644 (file)
@@ -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 \
index 71cb626edf7d2ec29ca8dd6891527ebe5d4e1daa..858e38877fbaf1e632f5edf28ea250988ea87c4a 100644 (file)
@@ -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 \
index 07cdb783510fd30435cdca2110e1529d1280f759..1cdbb57401eafc5fe7c470a30446377e5c338b2f 100644 (file)
@@ -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 \
index 035a243c3cd010267d501a3b6b080c442c9340ea..1f431dad3ad0ec5cdec9c33f9fde08f8b7ae87ce 100644 (file)
@@ -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 \
index 34a1248a45697e7566013fced2a047d7348ac337..e600ba49fc0a2b2650624c4eb6448948df89250a 100644 (file)
@@ -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 \
index f41504ecd5eccfcdfc1dc7ab4a62ca120b9a7fdf..741f39da4e030b7c29ce55204b35b6028272acc4 100644 (file)
@@ -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 \
index 5eb528b7134d54ae84699da0e6e26bb76f947aab..99ad7199c751eabc6cee8cc8f490a207411b774e 100644 (file)
@@ -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 \
index 04390d9e6c4758e6c40a3a951719425f732edde1..c18b275c0a89a2824b3a22c69e09f0a7909be3af 100644 (file)
@@ -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 \
index ee5678ccf953b597063f99a98bd2700e78e9397e..8cace2c041b12f9e5f01fff0460cb77bdf8c80c7 100644 (file)
@@ -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 \
index 9ae8fbc18b47b9153ef85d9f820a9718072ffbc9..863392544f84c2870317497dc0199b0e76c62395 100644 (file)
@@ -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) {
index cd9971b0ae86b54edb34edad5c670a047c206a17..2a1a4509ec0e427a2f399a985aa3682384312f4f 100644 (file)
@@ -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 \
index d9ab1b20d10da4fac17cc7e79879fdc726f9f8d4..1aa13065f7828f39c80d0ff59b1a9914f2f98d66 100644 (file)
@@ -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 \
index 7ff309b980fe7c61a073821006afc076e3bbf5d0..4101feb85bb40a19b55985c0be8b45a3cefe1394 100644 (file)
@@ -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 \
index 996d15cdd12ad7af2bdb1215e428d503a0ace3c5..a312c948cfbd139b3322bed7c4fcda4c1a8d1ae3 100644 (file)
@@ -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 \
index 7623e4685ab0c61ca270903980beb29a96c6d64d..baa20881a0498f8e4e0807f2ff9d7166171c75d9 100644 (file)
@@ -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 \
index ef8b4f9a630ac23beb4fb7e33b145cb20953c348..4797a9baf2ca00e247034e851a4b7b83fc2f9c82 100644 (file)
@@ -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