xfs
[Top] [All Lists]

XFS and write barriers.

To: xfs@xxxxxxxxxxx
Subject: XFS and write barriers.
From: Neil Brown <neilb@xxxxxxx>
Date: Fri, 23 Mar 2007 12:26:31 +1100
Sender: xfs-bounce@xxxxxxxxxxx
Hi,
 I have two concerns related to XFS and write barrier support that I'm
 hoping can be resolved.

Firstly in xfs_mountfs_check_barriers in fs/xfs/linux-2.6/xfs_super.c,
it tests ....->queue->ordered to see if that is QUEUE_ORDERED_NONE.
If it is, then barriers are disabled.

I think this is a layering violation - xfs really has no business
looking that deeply into the device.
For dm and md devices, ->ordered is never used and so never set, so
xfs will never use barriers on those devices (as the default value is
0 or NONE).  It is true that md and dm could set ->ordered to some
non-zero value just to please XFS, but that would be telling a lie and
there is no possible value that is relevant to a layered devices.

I think this test should just be removed and the xfs_barrier_test
should be the main mechanism for seeing if barriers work.

Secondly, if a barrier write fails due to EOPNOTSUPP, it should be
retried without the barrier (after possibly waiting for dependant
requests to complete).  This is what other filesystems do, but I
cannot find the code in xfs which does this.
The approach taken by xfs_barrier_test seems to suggest that xfs does
do this... could someone please point me to the code ?

This is particularly important for md/raid1 as it is quite possible
that barriers will be supported at first, but after a failure and
different device on a different controller could be swapped in that
does not support barriers.

Thanks for your time,
NeilBrown


<Prev in Thread] Current Thread [Next in Thread>