[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210212132.IMthcXXM-lkp@intel.com>
Date: Fri, 21 Oct 2022 21:16:40 +0800
From: kernel test robot <lkp@...el.com>
To: Eric Biggers <ebiggers@...gle.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [ebiggers:wip-fsverity 5/6] fs/buffer.c:2265:5: warning: stack frame
size (2144) exceeds limit (1024) in '__block_read_full_folio'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git wip-fsverity
head: cea8a484a322bee9a5b9bbfe9ad7f1fa0c6d2056
commit: 9056d4b36d063ba39a06fb55e1ed535c864f4a2b [5/6] fs/buffer.c: introduce __block_read_full_folio() for ext4
config: hexagon-buildonly-randconfig-r002-20221019
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/commit/?id=9056d4b36d063ba39a06fb55e1ed535c864f4a2b
git remote add ebiggers https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git
git fetch --no-tags ebiggers wip-fsverity
git checkout 9056d4b36d063ba39a06fb55e1ed535c864f4a2b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
In file included from fs/buffer.c:24:
In file included from include/linux/syscalls.h:88:
In file included from include/trace/syscall.h:7:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from fs/buffer.c:24:
In file included from include/linux/syscalls.h:88:
In file included from include/trace/syscall.h:7:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from fs/buffer.c:24:
In file included from include/linux/syscalls.h:88:
In file included from include/trace/syscall.h:7:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
>> fs/buffer.c:2265:5: warning: stack frame size (2144) exceeds limit (1024) in '__block_read_full_folio' [-Wframe-larger-than]
int __block_read_full_folio(struct folio *folio, loff_t limit,
^
7 warnings generated.
vim +/__block_read_full_folio +2265 fs/buffer.c
2264
> 2265 int __block_read_full_folio(struct folio *folio, loff_t limit,
2266 get_block_t *get_block)
2267 {
2268 struct inode *inode = folio->mapping->host;
2269 sector_t iblock, lblock;
2270 struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];
2271 unsigned int blocksize, bbits;
2272 int nr, i;
2273 int fully_mapped = 1;
2274 bool page_error = false;
2275
2276 VM_BUG_ON_FOLIO(folio_test_large(folio), folio);
2277
2278 head = create_page_buffers(&folio->page, inode, 0);
2279 blocksize = head->b_size;
2280 bbits = block_size_bits(blocksize);
2281
2282 iblock = (sector_t)folio->index << (PAGE_SHIFT - bbits);
2283 lblock = (limit+blocksize-1) >> bbits;
2284 bh = head;
2285 nr = 0;
2286 i = 0;
2287
2288 do {
2289 if (buffer_uptodate(bh))
2290 continue;
2291
2292 if (!buffer_mapped(bh)) {
2293 int err = 0;
2294
2295 fully_mapped = 0;
2296 if (iblock < lblock) {
2297 WARN_ON(bh->b_size != blocksize);
2298 err = get_block(inode, iblock, bh, 0);
2299 if (err) {
2300 folio_set_error(folio);
2301 page_error = true;
2302 }
2303 }
2304 if (!buffer_mapped(bh)) {
2305 folio_zero_range(folio, i * blocksize,
2306 blocksize);
2307 if (!err)
2308 set_buffer_uptodate(bh);
2309 continue;
2310 }
2311 /*
2312 * get_block() might have updated the buffer
2313 * synchronously
2314 */
2315 if (buffer_uptodate(bh))
2316 continue;
2317 }
2318 arr[nr++] = bh;
2319 } while (i++, iblock++, (bh = bh->b_this_page) != head);
2320
2321 if (fully_mapped)
2322 folio_set_mappedtodisk(folio);
2323
2324 if (!nr) {
2325 /*
2326 * All buffers are uptodate - we can set the folio uptodate
2327 * as well. But not if get_block() returned an error.
2328 */
2329 if (!page_error)
2330 folio_mark_uptodate(folio);
2331 folio_unlock(folio);
2332 return 0;
2333 }
2334
2335 /* Stage two: lock the buffers */
2336 for (i = 0; i < nr; i++) {
2337 bh = arr[i];
2338 lock_buffer(bh);
2339 mark_buffer_async_read(bh);
2340 }
2341
2342 /*
2343 * Stage 3: start the IO. Check for uptodateness
2344 * inside the buffer lock in case another process reading
2345 * the underlying blockdev brought it uptodate (the sct fix).
2346 */
2347 for (i = 0; i < nr; i++) {
2348 bh = arr[i];
2349 if (buffer_uptodate(bh))
2350 end_buffer_async_read(bh, 1);
2351 else
2352 submit_bh(REQ_OP_READ, bh);
2353 }
2354 return 0;
2355 }
2356 EXPORT_SYMBOL(__block_read_full_folio);
2357
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (153735 bytes)
Powered by blists - more mailing lists