As same as with other IO submission, we must unlock a block group for the next allocation. Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx> --- fs/btrfs/inode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 283ac11849b1..d7be97c6a069 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8519,6 +8519,7 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, struct btrfs_io_bio *io_bio; bool write = (bio_op(dio_bio) == REQ_OP_WRITE); int ret = 0; + u64 disk_bytenr; bio = btrfs_bio_clone(dio_bio); @@ -8562,7 +8563,11 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, dio_data->unsubmitted_oe_range_end; } + disk_bytenr = dip->disk_bytenr; ret = btrfs_submit_direct_hook(dip); + if (write) + btrfs_hmzoned_data_io_unlock_logical( + btrfs_sb(inode->i_sb), disk_bytenr); if (!ret) return; -- 2.22.0