lkml.org 
[lkml]   [2021]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-next: build warning after merge of the kspp-gustavo tree
From
Date


On 6/23/21 08:14, David Sterba wrote:
> On Wed, Jun 23, 2021 at 08:39:01AM +1000, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the kspp-gustavo tree, today's linux-next build (powerpc
>> ppc64_defconfig) produced this warning:
>>
>> In file included from fs/btrfs/ctree.h:9,
>> from fs/btrfs/struct-funcs.c:8:
>> fs/btrfs/struct-funcs.c: In function 'btrfs_get_token_16':
>> fs/btrfs/struct-funcs.c:80:46: warning: array subscript 1 is above array bounds of 'struct page *[1]' [-Warray-bounds]
>> 80 | token->kaddr = page_address(token->eb->pages[idx + 1]); \
>> | ~~~~~~~~~~~~~~~~^~~~~~~~~
>
> The warning is correct, on powerpc and 64k pages the array has only 1
> item, ie. only index 0 is valid. The overflow won't happen in practice
> though because of previous branch that would happen in 100% cases. The
> code handles when some bytes cross 2 pages but on 64k pages it's all
> just one page.
>
> To allow the warning to be enabled globally we'll fix it, I'll let
> Gustavo know once it's done.

Awesome. :)

Thanks, David.
--
Gustavo

\
 
 \ /
  Last update: 2021-06-23 21:02    [W:0.156 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site