aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsops.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-01-11 10:22:40 +1100
committerDave Chinner <david@fromorbit.com>2011-01-11 10:22:40 +1100
commiteda77982729b7170bdc9e8855f0682edf322d277 (patch)
tree09ed733da9142ba979d6440add49f05772da11a4 /fs/xfs/xfs_fsops.c
parent4d8d15812fd9bc96d0da11467d23e0373feae933 (diff)
downloadkernel_samsung_smdk4412-eda77982729b7170bdc9e8855f0682edf322d277.zip
kernel_samsung_smdk4412-eda77982729b7170bdc9e8855f0682edf322d277.tar.gz
kernel_samsung_smdk4412-eda77982729b7170bdc9e8855f0682edf322d277.tar.bz2
xfs: serialise unaligned direct IOs
When two concurrent unaligned, non-overlapping direct IOs are issued to the same block, the direct Io layer will race to zero the block. The result is that one of the concurrent IOs will overwrite data written by the other IO with zeros. This is demonstrated by the xfsqa test 240. To avoid this problem, serialise all unaligned direct IOs to an inode with a big hammer. We need a big hammer approach as we need to serialise AIO as well, so we can't just block writes on locks. Hence, the big hammer is calling xfs_ioend_wait() while holding out other unaligned direct IOs from starting. We don't bother trying to serialised aligned vs unaligned IOs as they are overlapping IO and the result of concurrent overlapping IOs is undefined - the result of either IO is a valid result so we let them race. Hence we only penalise unaligned IO, which already has a major overhead compared to aligned IO so this isn't a major problem. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
0 files changed, 0 insertions, 0 deletions