diff options
author | Qu Wenruo <wqu@suse.com> | 2021-09-27 10:21:50 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 20:08:04 +0300 |
commit | 86ccbb4d2a2af4109430df518c995a4f7d14dfd2 (patch) | |
tree | 88ac16e7e4dc688cb21e5442cd5a683625f5c20b /scripts/generate_rust_analyzer.py | |
parent | e4f9434749d85aa99e7e58edce2e003951d8e8e1 (diff) | |
download | linux-86ccbb4d2a2af4109430df518c995a4f7d14dfd2.tar.xz |
btrfs: handle errors properly inside btrfs_submit_compressed_read()
There are quite some BUG_ON()s inside btrfs_submit_compressed_read(),
namely all errors inside the for() loop relies on BUG_ON() to handle
-ENOMEM.
Handle these errors properly by:
- Wait for submitted bios to finish first
Using wake_var_event() APIs to wait without introducing extra memory
overhead inside compressed_bio.
This allows us to wait for any submitted bio to finish, while still
keeps the compressed_bio from being freed.
- Introduce finish_compressed_bio_read() to finish the compressed_bio
- Properly end the bio and finish compressed_bio when error happens
Now in btrfs_submit_compressed_read() even when the bio submission
failed, we can properly handle the error without triggering BUG_ON().
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions