mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Remove the bio_empty_barrier() check.
To determine whether the kernel is capable of handling empty barrier BIOs, we check for the presence of the bio_empty_barrier() macro, which was introduced in 2.6.24. If this macro is defined, then we can flush disk vdevs; if it isn't, then flushing is disabled. Unfortunately, the bio_empty_barrier() macro was removed in 2.6.37, even though the kernel is still capable of handling empty barrier BIOs. As a result, flushing is effectively disabled on kernels >= 2.6.37, meaning that starting from this kernel version, zfs doesn't use barriers to guarantee on-disk data consistency. This is quite bad and can lead to potential data corruption on power failures. This patch fixes the issue by removing the configure check for bio_empty_barrier(), as we don't support kernels <= 2.6.24 anymore. Thanks to Richard Kojedzinszky for catching this nasty bug. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1318
This commit is contained in:
committed by
Brian Behlendorf
parent
d75af3c0eb
commit
d9b0ebbe82
@@ -1,19 +0,0 @@
|
||||
dnl #
|
||||
dnl # 2.6.24 API change
|
||||
dnl # Empty write barriers are now supported and we should use them.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_EMPTY_BARRIER], [
|
||||
AC_MSG_CHECKING([whether bio_empty_barrier() is defined])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio bio;
|
||||
(void)bio_empty_barrier(&bio);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_EMPTY_BARRIER, 1,
|
||||
[bio_empy_barrier() is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
@@ -16,7 +16,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
||||
ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS
|
||||
ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE
|
||||
ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE
|
||||
ZFS_AC_KERNEL_BIO_EMPTY_BARRIER
|
||||
ZFS_AC_KERNEL_BIO_FAILFAST
|
||||
ZFS_AC_KERNEL_BIO_FAILFAST_DTD
|
||||
ZFS_AC_KERNEL_REQ_FAILFAST_MASK
|
||||
|
||||
Reference in New Issue
Block a user