diff options
author | Josef Bacik <jbacik@fusionio.com> | 2012-07-31 22:28:48 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-08-28 22:53:27 +0200 |
commit | eb838e73dc2121d2bae47d5678952cd7d48793b5 (patch) | |
tree | e451338c2f68b413f1a3f5821ec0d63f8ef60196 /kernel/time | |
parent | Btrfs: fix some endian bugs handling the root times (diff) | |
download | linux-eb838e73dc2121d2bae47d5678952cd7d48793b5.tar.xz linux-eb838e73dc2121d2bae47d5678952cd7d48793b5.zip |
Btrfs: lock extents as we map them in DIO
A deadlock in xfstests 113 was uncovered by commit
d187663ef24cd3d033f0cbf2867e70b36a3a90b8
This is because we would not return EIOCBQUEUED for short AIO reads, instead
we'd wait for the DIO to complete and then return the amount of data we
transferred, which would allow our stuff to unlock the remaning amount. But
with this change this no longer happens, so if we have a short AIO read (for
example if we try to read past EOF), we could leave the section from EOF to
the end of where we tried to read locked. Fixing this is tricky since there
is no clear way to know exactly how much data DIO truly submitted for IO, so
to make this less hard on ourselves and less combersome we need to lock the
extents as we try to map them, and then we unlock any areas we didn't
actually map. This makes us completely safe from deadlocks and reliance on
a particular behavior of the DIO code. This also lays the groundwork for
allowing us to use the normal csum storage method for reads which means we
can remove an allocation. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'kernel/time')
0 files changed, 0 insertions, 0 deletions