diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2022-09-09 15:59:55 +0900 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-13 14:05:18 +0200 |
commit | 2dd7e7bc02829eded71be2342a93dc035f5223f9 (patch) | |
tree | 6661bb52b0e28ef9df7495d6be04d337add83aa5 /fs/xfs/xfs_iops.h | |
parent | a362bb864b8db4861977d00bd2c3222503ccc34b (diff) | |
download | linux-stable-2dd7e7bc02829eded71be2342a93dc035f5223f9.tar.gz linux-stable-2dd7e7bc02829eded71be2342a93dc035f5223f9.tar.bz2 linux-stable-2dd7e7bc02829eded71be2342a93dc035f5223f9.zip |
btrfs: zoned: wait for extent buffer IOs before finishing a zone
Before sending REQ_OP_ZONE_FINISH to a zone, we need to ensure that
ongoing IOs already finished. Or, we will see a "Zone Is Full" error for
the IOs, as the ZONE_FINISH command makes the zone full.
We ensure that with btrfs_wait_block_group_reservations() and
btrfs_wait_ordered_roots() for a data block group. And, for a metadata
block group, the comparison of alloc_offset vs meta_write_pointer mostly
ensures IOs for the allocated region already sent. However, there still
can be a little time frame where the IOs are sent but not yet completed.
Introduce wait_eb_writebacks() to ensure such IOs are completed for a
metadata block group. It walks the buffer_radix to find extent buffers in
the block group and calls wait_on_extent_buffer_writeback() on them.
Fixes: afba2bc036b0 ("btrfs: zoned: implement active zone tracking")
CC: stable@vger.kernel.org # 5.19+
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/xfs/xfs_iops.h')
0 files changed, 0 insertions, 0 deletions