cost of tdb transactions on ext4 with barriers

ronnie sahlberg ronniesahlberg at
Fri Feb 12 02:17:51 MST 2010

FS guys have a lot to learn from SCSI.

In SCSI you have a flag, FUA, in the rpc header for each individual
i/o (WRITE10) that says
* you may just write this to cache if you think this benefits performance
* this i/o goes to the medium. period.   and if not, we will make you
suffer, publicly, next time we t.10 people meet up.

Kind of what you might expect that fsync() would provide on non-broken systems.

ronnie sahlberg

On Fri, Feb 12, 2010 at 8:07 PM, Olaf Fraczyk <olaf at> wrote:
> Hello,
> In XFS it depends if you have wirte cache enabled.
> BTW. the XFS journals only metadata.
> So to be safe you need:
> 1. Write cache off - the barriers are not needed
> or
> 2. Write cache on, and barriers on
> If you have writeback cache enabled and barriers off, then on power
> failure you can get inconsistent filesystem.
> Most people claim, that disabling both barriers and write cache is
> better in terms of performance than cache and barriers enabled.
> I personally always turn the wirteback cache off on my drives.
> The above was for XFS but I see no point that should make it for ext4
> any different.
> It is safe to use writeback cache and have barriers disabled only if you
> can assure that the write cache (both on controller and in hdd drive)
> will survive crash or power outage.
> Best regards,
> Olaf
> On Fri, 2010-02-12 at 13:57 +1100, tridge at wrote:
>> Hi Ronnie,
>>  > Do you really need barriers on ext4?
>> It depends if you want your data to survive a machine crash.
>> For my development box, I'm happy to risk losing a small amount of
>> data on a machine crash. For a production box it's not such a good
>> thing.
>> I'm not aware of anything unique in ext4 that allows it to avoid data
>> corruption on system crash with barriers off. Maybe Rusty knows of
>> something?
>> Cheers, Tridge
> --
> Olaf Frączyk <olaf at>

More information about the samba-technical mailing list