summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorEtienne Dechamps <[email protected]>2013-02-24 11:22:07 +0000
committerBrian Behlendorf <[email protected]>2013-02-24 10:22:34 -0800
commitd9b0ebbe824469d178a05b0fb9004e4afce86009 (patch)
tree9c7a5c87282f39a353e37cb51e8ba57bada60ada /module/zfs
parentd75af3c0ebb4e31ece087aeecfeff282cb6f1361 (diff)
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 <[email protected]> Closes #1318
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/vdev_disk.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
index cbf0a4d4f..e902a70e1 100644
--- a/module/zfs/vdev_disk.c
+++ b/module/zfs/vdev_disk.c
@@ -604,8 +604,6 @@ vdev_disk_physio(struct block_device *bdev, caddr_t kbuf,
return __vdev_disk_physio(bdev, NULL, kbuf, size, offset, flags);
}
-/* 2.6.24 API change */
-#ifdef HAVE_BIO_EMPTY_BARRIER
BIO_END_IO_PROTO(vdev_disk_io_flush_completion, bio, size, rc)
{
zio_t *zio = bio->bi_private;
@@ -646,13 +644,6 @@ vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
return 0;
}
-#else
-static int
-vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
-{
- return ENOTSUP;
-}
-#endif /* HAVE_BIO_EMPTY_BARRIER */
static int
vdev_disk_io_start(zio_t *zio)