From: Qu Wenruo Date: Tue, 6 Apr 2021 00:36:02 +0000 (+0800) Subject: btrfs: make lock_extent_buffer_for_io() to be subpage compatible X-Git-Tag: accepted/tizen/unified/20230118.172025~7052^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3156df944754d9984b1595994caa1c93b8cae3b;p=platform%2Fkernel%2Flinux-rpi.git btrfs: make lock_extent_buffer_for_io() to be subpage compatible For subpage metadata, we don't use page locking at all. So just skip the page locking part for subpage. The rest of the function can be reused. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e0713b0..396ba23 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3967,7 +3967,13 @@ static noinline_for_stack int lock_extent_buffer_for_io(struct extent_buffer *eb btrfs_tree_unlock(eb); - if (!ret) + /* + * Either we don't need to submit any tree block, or we're submitting + * subpage eb. + * Subpage metadata doesn't use page locking at all, so we can skip + * the page locking. + */ + if (!ret || fs_info->sectorsize < PAGE_SIZE) return ret; num_pages = num_extent_pages(eb);