Write barriers on MD RAID1

From: Ken Milmore
Date: Sat May 23 2009 - 20:08:44 EST



Support for write barriers on MD RAID1 devices appears to be broken on 2.6.29 and later kernels. Mounting an ext3 or ext4 filesystem over an md raid1 block device gives the kernel message:

JBD: barrier-based sync failed on md0 - disabling barriers

Is this intentional? It looks like a regression to me, since write barriers (ostensibly) worked for MD RAID1 on earlier kernels (well, all of the 2.6.27 series at least...)

Doing a git bisect suggested that this is the culprit:

commit cec0707e40ae25794b5a2de7b7f03c51961f80d9
Author: Jens Axboe <jens.axboe@xxxxxxxxxx>
Date: Tue Jan 13 15:28:32 2009 +0100

block: silently error an unsupported barrier bio

Rolling this back from 2.6.29.4 made the JBD error message go away for me. I tried to do some disk benchmarking to determine if write barriers were really still working, but the results were not very conclusive.

Details of test setup:
- 2.6.29.4 kernel (config from slackware-current)
- ext3 filesystem (mounted with barrier=1), also tried ext4
- MD RAID1 block device over two SATA disks
- Intel motherboard AHCI controller (82801)

I got similar behaviour on a virtualised setup using qemu, with the RAID over two emulated IDE disks.

Please contact me if I can provide any further information.

-Ken Milmore.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/