aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2transport.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2021-07-28 18:00:24 +0200
committerDavid Sterba <dsterba@suse.com>2021-07-29 13:01:04 +0200
commit7280305eb57dd32735f795ed4ee679bf9854f9d0 (patch)
treef3b169d1e5110807a30e7b1c4ce39b5db4a45c5c /fs/cifs/smb2transport.c
parentbtrfs: fix rw device counting in __btrfs_free_extra_devids (diff)
downloadlinux-dev-7280305eb57dd32735f795ed4ee679bf9854f9d0.tar.xz
linux-dev-7280305eb57dd32735f795ed4ee679bf9854f9d0.zip
btrfs: calculate number of eb pages properly in csum_tree_block
Building with -Warray-bounds on systems with 64K pages there's a warning: fs/btrfs/disk-io.c: In function ‘csum_tree_block’: fs/btrfs/disk-io.c:226:34: warning: array subscript 1 is above array bounds of ‘struct page *[1]’ [-Warray-bounds] 226 | kaddr = page_address(buf->pages[i]); | ~~~~~~~~~~^~~ ./include/linux/mm.h:1630:48: note: in definition of macro ‘page_address’ 1630 | #define page_address(page) lowmem_page_address(page) | ^~~~ In file included from fs/btrfs/ctree.h:32, from fs/btrfs/disk-io.c:23: fs/btrfs/extent_io.h:98:15: note: while referencing ‘pages’ 98 | struct page *pages[1]; | ^~~~~ The compiler has no way to know that in that case the nodesize is exactly PAGE_SIZE, so the resulting number of pages will be correct (1). Let's use num_extent_pages that makes the case nodesize == PAGE_SIZE explicitly 1. Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/cifs/smb2transport.c')
0 files changed, 0 insertions, 0 deletions