diff options
author | Filipe Manana <fdmanana@suse.com> | 2015-11-24 16:23:54 +0000 |
---|---|---|
committer | Filipe Manana <fdmanana@suse.com> | 2015-12-17 10:59:49 +0000 |
commit | 14543774bd67a64f616431e5c9d1472f58979841 (patch) | |
tree | 7924d550c88cb86c0d7fc1022dc833c2ee67f407 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 7785a663c4beebdafeb300caf2818e7e6474abd1 (diff) |
Btrfs: fix error path when failing to submit bio for direct IO write
Commit 61de718fceb6 ("Btrfs: fix memory corruption on failure to submit
bio for direct IO") fixed problems with the error handling code after we
fail to submit a bio for direct IO. However there were 2 problems that it
did not address when the failure is due to memory allocation failures for
direct IO writes:
1) We considered that there could be only one ordered extent for the whole
IO range, which is not always true, as we can have multiple;
2) It did not set the bit BTRFS_ORDERED_IO_DONE in the ordered extent,
which can make other tasks running btrfs_wait_logged_extents() hang
forever, since they wait for that bit to be set. The general assumption
is that regardless of an error, the BTRFS_ORDERED_IO_DONE is always set
and it precedes setting the bit BTRFS_ORDERED_COMPLETE.
Fix these issues by moving part of the btrfs_endio_direct_write() handler
into a new helper function and having that new helper function called when
we fail to allocate memory to submit the bio (and its private object) for
a direct IO write.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions