summaryrefslogtreecommitdiff
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2015-12-08 19:23:20 +0000
committerFilipe Manana <fdmanana@suse.com>2015-12-17 10:59:51 +0000
commitf28a492878170f39002660a26c329201cf678d74 (patch)
tree9c030f6229100495d8135a50e9aed60c725536ae /drivers/hwtracing
parentb850ae14278dfc49c3a03b39357214fc79330db9 (diff)
Btrfs: fix leaking of ordered extents after direct IO write error
When doing a direct IO write, __blockdev_direct_IO() can call the btrfs_get_blocks_direct() callback one or more times before it calls the btrfs_submit_direct() callback. However it can fail after calling the first callback and before calling the second callback, which is a problem because the first one creates ordered extents and the second one is the one that submits bios that cover the ordered extents created by the first one. That means the ordered extents will never complete nor have any of the flags BTRFS_ORDERED_IO_DONE / BTRFS_ORDERED_IOERR set, resulting in subsequent operations (such as other direct IO writes, buffered writes or hole punching) that lock the same IO range and lookup for ordered extents in the range to hang forever waiting for those ordered extents because they can not complete ever, since no bio was submitted. Fix this by tracking a range of created ordered extents that don't have yet corresponding bios submitted and completing the ordered extents in the range if __blockdev_direct_IO() fails with an error. Signed-off-by: Filipe Manana <fdmanana@suse.com>
Diffstat (limited to 'drivers/hwtracing')
0 files changed, 0 insertions, 0 deletions