aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorNaohiro Aota <naohiro.aota@wdc.com>2022-05-03 17:48:53 -0700
committerDavid Sterba <dsterba@suse.com>2022-05-16 17:17:32 +0200
commit56fbb0a4e8b3e929e41cc846e6ef89eb01152201 (patch)
tree75be911f6a75bfb976634d369897a0d8edc7dcd9 /init
parentbtrfs: zoned: finish block group when there are no more allocatable bytes left (diff)
downloadlinux-dev-56fbb0a4e8b3e929e41cc846e6ef89eb01152201.tar.xz
linux-dev-56fbb0a4e8b3e929e41cc846e6ef89eb01152201.zip
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 'init')
0 files changed, 0 insertions, 0 deletions