From: Anastasia Belova Date: Wed, 26 Apr 2023 11:53:23 +0000 (+0300) Subject: btrfs: print-tree: parent bytenr must be aligned to sector size X-Git-Tag: v6.6.17~4651^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c87f318e6f47696b4040b58f460d5c17ea0280e6;p=platform%2Fkernel%2Flinux-rpi.git btrfs: print-tree: parent bytenr must be aligned to sector size Check nodesize to sectorsize in alignment check in print_extent_item. The comment states that and this is correct, similar check is done elsewhere in the functions. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: ea57788eb76d ("btrfs: require only sector size alignment for parent eb bytenr") CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Qu Wenruo Signed-off-by: Anastasia Belova Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index b93c962..497b9db 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c @@ -151,10 +151,10 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type) pr_cont("shared data backref parent %llu count %u\n", offset, btrfs_shared_data_ref_count(eb, sref)); /* - * offset is supposed to be a tree block which - * must be aligned to nodesize. + * Offset is supposed to be a tree block which must be + * aligned to sectorsize. */ - if (!IS_ALIGNED(offset, eb->fs_info->nodesize)) + if (!IS_ALIGNED(offset, eb->fs_info->sectorsize)) pr_info( "\t\t\t(parent %llu not aligned to sectorsize %u)\n", offset, eb->fs_info->sectorsize);