fs/ntfs/mft.c:627:1: warning: the frame size of 2136 bytes is larger than 1024 bytes

From: kernel test robot
Date: Wed Jul 28 2021 - 09:00:39 EST


Hi Christophe,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ff1176468d368232b684f75e82563369208bc371
commit: 03fd42d458fb9cb69e712600bd69ff77ff3a45a8 powerpc/fixmap: Fix FIX_EARLY_DEBUG_BASE when page size is 256k
date: 1 year, 1 month ago
config: powerpc64-randconfig-r026-20210728 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.0
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/torvalds/linux.git/commit/?id=03fd42d458fb9cb69e712600bd69ff77ff3a45a8
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 03fd42d458fb9cb69e712600bd69ff77ff3a45a8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

fs/ntfs/mft.c: In function 'ntfs_sync_mft_mirror':
>> fs/ntfs/mft.c:627:1: warning: the frame size of 2136 bytes is larger than 1024 bytes [-Wframe-larger-than=]
627 | }
| ^
fs/ntfs/mft.c: In function 'write_mft_record_nolock':
fs/ntfs/mft.c:839:1: warning: the frame size of 2136 bytes is larger than 1024 bytes [-Wframe-larger-than=]
839 | }
| ^


vim +627 fs/ntfs/mft.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 435
^1da177e4c3f41 Linus Torvalds 2005-04-16 436 /**
^1da177e4c3f41 Linus Torvalds 2005-04-16 437 * ntfs_sync_mft_mirror - synchronize an mft record to the mft mirror
^1da177e4c3f41 Linus Torvalds 2005-04-16 438 * @vol: ntfs volume on which the mft record to synchronize resides
^1da177e4c3f41 Linus Torvalds 2005-04-16 439 * @mft_no: mft record number of mft record to synchronize
^1da177e4c3f41 Linus Torvalds 2005-04-16 440 * @m: mapped, mst protected (extent) mft record to synchronize
^1da177e4c3f41 Linus Torvalds 2005-04-16 441 * @sync: if true, wait for i/o completion
^1da177e4c3f41 Linus Torvalds 2005-04-16 442 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 443 * Write the mapped, mst protected (extent) mft record @m with mft record
^1da177e4c3f41 Linus Torvalds 2005-04-16 444 * number @mft_no to the mft mirror ($MFTMirr) of the ntfs volume @vol.
^1da177e4c3f41 Linus Torvalds 2005-04-16 445 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 446 * On success return 0. On error return -errno and set the volume errors flag
^1da177e4c3f41 Linus Torvalds 2005-04-16 447 * in the ntfs volume @vol.
^1da177e4c3f41 Linus Torvalds 2005-04-16 448 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 449 * NOTE: We always perform synchronous i/o and ignore the @sync parameter.
^1da177e4c3f41 Linus Torvalds 2005-04-16 450 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 451 * TODO: If @sync is false, want to do truly asynchronous i/o, i.e. just
^1da177e4c3f41 Linus Torvalds 2005-04-16 452 * schedule i/o via ->writepage or do it via kntfsd or whatever.
^1da177e4c3f41 Linus Torvalds 2005-04-16 453 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 454 int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no,
^1da177e4c3f41 Linus Torvalds 2005-04-16 455 MFT_RECORD *m, int sync)
^1da177e4c3f41 Linus Torvalds 2005-04-16 456 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 457 struct page *page;
^1da177e4c3f41 Linus Torvalds 2005-04-16 458 unsigned int blocksize = vol->sb->s_blocksize;
^1da177e4c3f41 Linus Torvalds 2005-04-16 459 int max_bhs = vol->mft_record_size / blocksize;
ab62ef82ea49b8 Kees Cook 2018-08-17 460 struct buffer_head *bhs[MAX_BHS];
^1da177e4c3f41 Linus Torvalds 2005-04-16 461 struct buffer_head *bh, *head;
^1da177e4c3f41 Linus Torvalds 2005-04-16 462 u8 *kmirr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 463 runlist_element *rl;
^1da177e4c3f41 Linus Torvalds 2005-04-16 464 unsigned int block_start, block_end, m_start, m_end, page_ofs;
^1da177e4c3f41 Linus Torvalds 2005-04-16 465 int i_bhs, nr_bhs, err = 0;
78af34f03d33d2 Anton Altaparmakov 2006-02-24 466 unsigned char blocksize_bits = vol->sb->s_blocksize_bits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 467
^1da177e4c3f41 Linus Torvalds 2005-04-16 468 ntfs_debug("Entering for inode 0x%lx.", mft_no);
^1da177e4c3f41 Linus Torvalds 2005-04-16 469 BUG_ON(!max_bhs);
ab62ef82ea49b8 Kees Cook 2018-08-17 470 if (WARN_ON(max_bhs > MAX_BHS))
ab62ef82ea49b8 Kees Cook 2018-08-17 471 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 472 if (unlikely(!vol->mftmirr_ino)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 473 /* This could happen during umount... */
^1da177e4c3f41 Linus Torvalds 2005-04-16 474 err = ntfs_sync_mft_mirror_umount(vol, mft_no, m);
^1da177e4c3f41 Linus Torvalds 2005-04-16 475 if (likely(!err))
^1da177e4c3f41 Linus Torvalds 2005-04-16 476 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 477 goto err_out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 478 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 479 /* Get the page containing the mirror copy of the mft record @m. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 480 page = ntfs_map_page(vol->mftmirr_ino->i_mapping, mft_no >>
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 481 (PAGE_SHIFT - vol->mft_record_size_bits));
^1da177e4c3f41 Linus Torvalds 2005-04-16 482 if (IS_ERR(page)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 483 ntfs_error(vol->sb, "Failed to map mft mirror page.");
^1da177e4c3f41 Linus Torvalds 2005-04-16 484 err = PTR_ERR(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 485 goto err_out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 486 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 487 lock_page(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 488 BUG_ON(!PageUptodate(page));
^1da177e4c3f41 Linus Torvalds 2005-04-16 489 ClearPageUptodate(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 490 /* Offset of the mft mirror record inside the page. */
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 491 page_ofs = (mft_no << vol->mft_record_size_bits) & ~PAGE_MASK;
^1da177e4c3f41 Linus Torvalds 2005-04-16 492 /* The address in the page of the mirror copy of the mft record @m. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 493 kmirr = page_address(page) + page_ofs;
^1da177e4c3f41 Linus Torvalds 2005-04-16 494 /* Copy the mst protected mft record to the mirror. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 495 memcpy(kmirr, m, vol->mft_record_size);
^1da177e4c3f41 Linus Torvalds 2005-04-16 496 /* Create uptodate buffers if not present. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 497 if (unlikely(!page_has_buffers(page))) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 498 struct buffer_head *tail;
^1da177e4c3f41 Linus Torvalds 2005-04-16 499
640ab98fb3629c Jens Axboe 2017-09-27 500 bh = head = alloc_page_buffers(page, blocksize, true);
^1da177e4c3f41 Linus Torvalds 2005-04-16 501 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 502 set_buffer_uptodate(bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 503 tail = bh;
^1da177e4c3f41 Linus Torvalds 2005-04-16 504 bh = bh->b_this_page;
^1da177e4c3f41 Linus Torvalds 2005-04-16 505 } while (bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 506 tail->b_this_page = head;
14ed109e3f3daa Guoqing Jiang 2020-06-01 507 attach_page_private(page, head);
^1da177e4c3f41 Linus Torvalds 2005-04-16 508 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 509 bh = head = page_buffers(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 510 BUG_ON(!bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 511 rl = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 512 nr_bhs = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 513 block_start = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 514 m_start = kmirr - (u8*)page_address(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 515 m_end = m_start + vol->mft_record_size;
^1da177e4c3f41 Linus Torvalds 2005-04-16 516 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 517 block_end = block_start + blocksize;
^1da177e4c3f41 Linus Torvalds 2005-04-16 518 /* If the buffer is outside the mft record, skip it. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 519 if (block_end <= m_start)
^1da177e4c3f41 Linus Torvalds 2005-04-16 520 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 521 if (unlikely(block_start >= m_end))
^1da177e4c3f41 Linus Torvalds 2005-04-16 522 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 523 /* Need to map the buffer if it is not mapped already. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 524 if (unlikely(!buffer_mapped(bh))) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 525 VCN vcn;
^1da177e4c3f41 Linus Torvalds 2005-04-16 526 LCN lcn;
^1da177e4c3f41 Linus Torvalds 2005-04-16 527 unsigned int vcn_ofs;
^1da177e4c3f41 Linus Torvalds 2005-04-16 528
e74589ac250e46 Anton Altaparmakov 2005-08-16 529 bh->b_bdev = vol->sb->s_bdev;
^1da177e4c3f41 Linus Torvalds 2005-04-16 530 /* Obtain the vcn and offset of the current block. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 531 vcn = ((VCN)mft_no << vol->mft_record_size_bits) +
^1da177e4c3f41 Linus Torvalds 2005-04-16 532 (block_start - m_start);
^1da177e4c3f41 Linus Torvalds 2005-04-16 533 vcn_ofs = vcn & vol->cluster_size_mask;
^1da177e4c3f41 Linus Torvalds 2005-04-16 534 vcn >>= vol->cluster_size_bits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 535 if (!rl) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 536 down_read(&NTFS_I(vol->mftmirr_ino)->
^1da177e4c3f41 Linus Torvalds 2005-04-16 537 runlist.lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 538 rl = NTFS_I(vol->mftmirr_ino)->runlist.rl;
^1da177e4c3f41 Linus Torvalds 2005-04-16 539 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 540 * $MFTMirr always has the whole of its runlist
^1da177e4c3f41 Linus Torvalds 2005-04-16 541 * in memory.
^1da177e4c3f41 Linus Torvalds 2005-04-16 542 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 543 BUG_ON(!rl);
^1da177e4c3f41 Linus Torvalds 2005-04-16 544 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 545 /* Seek to element containing target vcn. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 546 while (rl->length && rl[1].vcn <= vcn)
^1da177e4c3f41 Linus Torvalds 2005-04-16 547 rl++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 548 lcn = ntfs_rl_vcn_to_lcn(rl, vcn);
^1da177e4c3f41 Linus Torvalds 2005-04-16 549 /* For $MFTMirr, only lcn >= 0 is a successful remap. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 550 if (likely(lcn >= 0)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 551 /* Setup buffer head to correct block. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 552 bh->b_blocknr = ((lcn <<
^1da177e4c3f41 Linus Torvalds 2005-04-16 553 vol->cluster_size_bits) +
^1da177e4c3f41 Linus Torvalds 2005-04-16 554 vcn_ofs) >> blocksize_bits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 555 set_buffer_mapped(bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 556 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 557 bh->b_blocknr = -1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 558 ntfs_error(vol->sb, "Cannot write mft mirror "
^1da177e4c3f41 Linus Torvalds 2005-04-16 559 "record 0x%lx because its "
^1da177e4c3f41 Linus Torvalds 2005-04-16 560 "location on disk could not "
^1da177e4c3f41 Linus Torvalds 2005-04-16 561 "be determined (error code "
^1da177e4c3f41 Linus Torvalds 2005-04-16 562 "%lli).", mft_no,
^1da177e4c3f41 Linus Torvalds 2005-04-16 563 (long long)lcn);
^1da177e4c3f41 Linus Torvalds 2005-04-16 564 err = -EIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 565 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 566 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 567 BUG_ON(!buffer_uptodate(bh));
^1da177e4c3f41 Linus Torvalds 2005-04-16 568 BUG_ON(!nr_bhs && (m_start != block_start));
^1da177e4c3f41 Linus Torvalds 2005-04-16 569 BUG_ON(nr_bhs >= max_bhs);
^1da177e4c3f41 Linus Torvalds 2005-04-16 570 bhs[nr_bhs++] = bh;
^1da177e4c3f41 Linus Torvalds 2005-04-16 571 BUG_ON((nr_bhs >= max_bhs) && (m_end != block_end));
^1da177e4c3f41 Linus Torvalds 2005-04-16 572 } while (block_start = block_end, (bh = bh->b_this_page) != head);
^1da177e4c3f41 Linus Torvalds 2005-04-16 573 if (unlikely(rl))
^1da177e4c3f41 Linus Torvalds 2005-04-16 574 up_read(&NTFS_I(vol->mftmirr_ino)->runlist.lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 575 if (likely(!err)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 576 /* Lock buffers and start synchronous write i/o on them. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 577 for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 578 struct buffer_head *tbh = bhs[i_bhs];
^1da177e4c3f41 Linus Torvalds 2005-04-16 579
ca5de404ff036a Nick Piggin 2008-08-02 580 if (!trylock_buffer(tbh))
^1da177e4c3f41 Linus Torvalds 2005-04-16 581 BUG();
^1da177e4c3f41 Linus Torvalds 2005-04-16 582 BUG_ON(!buffer_uptodate(tbh));
^1da177e4c3f41 Linus Torvalds 2005-04-16 583 clear_buffer_dirty(tbh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 584 get_bh(tbh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 585 tbh->b_end_io = end_buffer_write_sync;
2a222ca992c35a Mike Christie 2016-06-05 586 submit_bh(REQ_OP_WRITE, 0, tbh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 587 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 588 /* Wait on i/o completion of buffers. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 589 for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 590 struct buffer_head *tbh = bhs[i_bhs];
^1da177e4c3f41 Linus Torvalds 2005-04-16 591
^1da177e4c3f41 Linus Torvalds 2005-04-16 592 wait_on_buffer(tbh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 593 if (unlikely(!buffer_uptodate(tbh))) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 594 err = -EIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 595 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 596 * Set the buffer uptodate so the page and
^1da177e4c3f41 Linus Torvalds 2005-04-16 597 * buffer states do not become out of sync.
^1da177e4c3f41 Linus Torvalds 2005-04-16 598 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 599 set_buffer_uptodate(tbh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 600 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 601 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 602 } else /* if (unlikely(err)) */ {
^1da177e4c3f41 Linus Torvalds 2005-04-16 603 /* Clean the buffers. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 604 for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++)
^1da177e4c3f41 Linus Torvalds 2005-04-16 605 clear_buffer_dirty(bhs[i_bhs]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 606 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 607 /* Current state: all buffers are clean, unlocked, and uptodate. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 608 /* Remove the mst protection fixups again. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 609 post_write_mst_fixup((NTFS_RECORD*)kmirr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 610 flush_dcache_page(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 611 SetPageUptodate(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 612 unlock_page(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 613 ntfs_unmap_page(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 614 if (likely(!err)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 615 ntfs_debug("Done.");
^1da177e4c3f41 Linus Torvalds 2005-04-16 616 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 617 ntfs_error(vol->sb, "I/O error while writing mft mirror "
^1da177e4c3f41 Linus Torvalds 2005-04-16 618 "record 0x%lx!", mft_no);
^1da177e4c3f41 Linus Torvalds 2005-04-16 619 err_out:
^1da177e4c3f41 Linus Torvalds 2005-04-16 620 ntfs_error(vol->sb, "Failed to synchronize $MFTMirr (error "
^1da177e4c3f41 Linus Torvalds 2005-04-16 621 "code %i). Volume will be left marked dirty "
^1da177e4c3f41 Linus Torvalds 2005-04-16 622 "on umount. Run ntfsfix on the partition "
^1da177e4c3f41 Linus Torvalds 2005-04-16 623 "after umounting to correct this.", -err);
^1da177e4c3f41 Linus Torvalds 2005-04-16 624 NVolSetErrors(vol);
^1da177e4c3f41 Linus Torvalds 2005-04-16 625 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 626 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @627 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 628

:::::: The code at line 627 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip