diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2022-05-03 17:48:53 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-05-16 17:17:32 +0200 |
commit | 56fbb0a4e8b3e929e41cc846e6ef89eb01152201 (patch) | |
tree | 75be911f6a75bfb976634d369897a0d8edc7dcd9 /fs/btrfs/extent_io.h | |
parent | 8b8a53998caefebfe5c8da7a74c2b601caf5dd48 (diff) | |
download | linux-56fbb0a4e8b3e929e41cc846e6ef89eb01152201.tar.bz2 |
btrfs: zoned: properly finish block group on metadata write
Commit be1a1d7a5d24 ("btrfs: zoned: finish fully written block group")
introduced zone finishing code both for data and metadata end_io path.
However, the metadata side is not working as it should. First, it
compares logical address (eb->start + eb->len) with offset within a
block group (cache->zone_capacity) in submit_eb_page(). That essentially
disabled zone finishing on metadata end_io path.
Furthermore, fixing the issue above revealed we cannot call
btrfs_zone_finish_endio() in end_extent_buffer_writeback(). We cannot
call btrfs_lookup_block_group() which require spin lock inside end_io
context.
Introduce btrfs_schedule_zone_finish_bg() to wait for the extent buffer
writeback and do the zone finish IO in a workqueue.
Also, drop EXTENT_BUFFER_ZONE_FINISH as it is no longer used.
Fixes: be1a1d7a5d24 ("btrfs: zoned: finish fully written block group")
CC: stable@vger.kernel.org # 5.16+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 17674b7e699c..956fa434df43 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -26,7 +26,6 @@ enum { /* write IO error */ EXTENT_BUFFER_WRITE_ERR, EXTENT_BUFFER_NO_CHECK, - EXTENT_BUFFER_ZONE_FINISH, }; /* these are flags for __process_pages_contig */ |