Skip to content

Commit d3e2996

Browse files
lorddoskiaskdave
authored andcommitted
btrfs: zoned: put block group after final usage
It's counter-intuitive (and wrong) to put the block group _before_ the final usage in submit_eb_page. Fix it by re-ordering the call to btrfs_put_block_group after its final reference. Also fix a minor typo in 'implies' Fixes: be1a1d7 ("btrfs: zoned: finish fully written block group") CC: [email protected] # 5.16+ Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 79c9234 commit d3e2996

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/btrfs/extent_io.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4786,11 +4786,12 @@ static int submit_eb_page(struct page *page, struct writeback_control *wbc,
47864786
return ret;
47874787
}
47884788
if (cache) {
4789-
/* Impiles write in zoned mode */
4790-
btrfs_put_block_group(cache);
4791-
/* Mark the last eb in a block group */
4789+
/*
4790+
* Implies write in zoned mode. Mark the last eb in a block group.
4791+
*/
47924792
if (cache->seq_zone && eb->start + eb->len == cache->zone_capacity)
47934793
set_bit(EXTENT_BUFFER_ZONE_FINISH, &eb->bflags);
4794+
btrfs_put_block_group(cache);
47944795
}
47954796
ret = write_one_eb(eb, wbc, epd);
47964797
free_extent_buffer(eb);

0 commit comments

Comments
 (0)