From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB1E5C433EF for ; Sat, 14 May 2022 17:37:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D47546B0073; Sat, 14 May 2022 13:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF66B6B0075; Sat, 14 May 2022 13:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B96BD6B0078; Sat, 14 May 2022 13:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A73C66B0073 for ; Sat, 14 May 2022 13:37:35 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 721E7213F1 for ; Sat, 14 May 2022 17:37:35 +0000 (UTC) X-FDA: 79465055670.09.65A5EC5 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf30.hostedemail.com (Postfix) with ESMTP id E5EF9800B3 for ; Sat, 14 May 2022 17:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652549852; x=1684085852; h=date:from:to:cc:subject:message-id:mime-version; bh=XsVdt0FhcIzVw0rRokJduF3wchDVprss4yCx6FQ2ltU=; b=jmMj3R23cmpa5+EMgxiSB1NNcaa0TKMRQrLBzlkpprJVrlzloFHJ1LGi Tj4HitcA7i3x0Ugr+7Z/Vq5YSxj2OEleruHY7IKVkpTR5hsLayS4l5XLH n6nmJQOZg3OdHDDICVD1V1mfkz1f7RMDXdzucDnMVwVOenfOsKpnDHcvI Lv+3EcJna+4tYX/FwdHXg3BXfAGwV/TQRjKiFQfm+4IP1Mgd2ZY7p22M0 0kYOQPIfbBgYGMw9ZsKyR7zfixAwHEbfdH1olEH19nFW3t6hNZhr5Wuh4 Nr+QYpYut4cXvyqgnf4hPCrp3iJZdoIZyWnL3Jd99OrSFABuh5+YrAaeT g==; X-IronPort-AV: E=McAfee;i="6400,9594,10347"; a="270217519" X-IronPort-AV: E=Sophos;i="5.91,226,1647327600"; d="scan'208";a="270217519" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2022 10:37:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,226,1647327600"; d="scan'208";a="625327500" Received: from lkp-server01.sh.intel.com (HELO d1462bc4b09b) ([10.239.97.150]) by fmsmga008.fm.intel.com with ESMTP; 14 May 2022 10:37:26 -0700 Received: from kbuild by d1462bc4b09b with local (Exim 4.95) (envelope-from ) id 1npvhl-0000sv-9W; Sat, 14 May 2022 17:37:25 +0000 Date: Sun, 15 May 2022 01:36:48 +0800 From: kernel test robot To: "Matthew Wilcox (Oracle)" Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Memory Management List Subject: [linux-next:master 10018/11651] fs/ntfs/aops.c:378:12: warning: stack frame size (2224) exceeds limit (1024) in 'ntfs_read_folio' Message-ID: <202205150117.sd6HzBVm-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Stat-Signature: uudx5gpy1nxaj3ammmj5gtztznhtjdri Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=jmMj3R23; spf=none (imf30.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 134.134.136.24) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E5EF9800B3 X-HE-Tag: 1652549831-720121 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 1e1b28b936aed946122b4e0991e7144fdbbfd77e commit: 933906f8e8e4110c56db9bddd1281e4e4983a2bb [10018/11651] ntfs: Convert ntfs to read_folio config: hexagon-randconfig-r041-20220513 (https://download.01.org/0day-ci/archive/20220515/202205150117.sd6HzBVm-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 38189438b69ca27b4c6ce707c52dbd217583d046) 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/next/linux-next.git/commit/?id=933906f8e8e4110c56db9bddd1281e4e4983a2bb git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 933906f8e8e4110c56db9bddd1281e4e4983a2bb # 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 fs/ntfs/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> fs/ntfs/aops.c:378:12: warning: stack frame size (2224) exceeds limit (1024) in 'ntfs_read_folio' [-Wframe-larger-than] static int ntfs_read_folio(struct file *file, struct folio *folio) ^ 1 warning generated. vim +/ntfs_read_folio +378 fs/ntfs/aops.c 359 360 /** 361 * ntfs_read_folio - fill a @folio of a @file with data from the device 362 * @file: open file to which the folio @folio belongs or NULL 363 * @folio: page cache folio to fill with data 364 * 365 * For non-resident attributes, ntfs_read_folio() fills the @folio of the open 366 * file @file by calling the ntfs version of the generic block_read_full_folio() 367 * function, ntfs_read_block(), which in turn creates and reads in the buffers 368 * associated with the folio asynchronously. 369 * 370 * For resident attributes, OTOH, ntfs_read_folio() fills @folio by copying the 371 * data from the mft record (which at this stage is most likely in memory) and 372 * fills the remainder with zeroes. Thus, in this case, I/O is synchronous, as 373 * even if the mft record is not cached at this point in time, we need to wait 374 * for it to be read in before we can do the copy. 375 * 376 * Return 0 on success and -errno on error. 377 */ > 378 static int ntfs_read_folio(struct file *file, struct folio *folio) 379 { 380 struct page *page = &folio->page; 381 loff_t i_size; 382 struct inode *vi; 383 ntfs_inode *ni, *base_ni; 384 u8 *addr; 385 ntfs_attr_search_ctx *ctx; 386 MFT_RECORD *mrec; 387 unsigned long flags; 388 u32 attr_len; 389 int err = 0; 390 391 retry_readpage: 392 BUG_ON(!PageLocked(page)); 393 vi = page->mapping->host; 394 i_size = i_size_read(vi); 395 /* Is the page fully outside i_size? (truncate in progress) */ 396 if (unlikely(page->index >= (i_size + PAGE_SIZE - 1) >> 397 PAGE_SHIFT)) { 398 zero_user(page, 0, PAGE_SIZE); 399 ntfs_debug("Read outside i_size - truncated?"); 400 goto done; 401 } 402 /* 403 * This can potentially happen because we clear PageUptodate() during 404 * ntfs_writepage() of MstProtected() attributes. 405 */ 406 if (PageUptodate(page)) { 407 unlock_page(page); 408 return 0; 409 } 410 ni = NTFS_I(vi); 411 /* 412 * Only $DATA attributes can be encrypted and only unnamed $DATA 413 * attributes can be compressed. Index root can have the flags set but 414 * this means to create compressed/encrypted files, not that the 415 * attribute is compressed/encrypted. Note we need to check for 416 * AT_INDEX_ALLOCATION since this is the type of both directory and 417 * index inodes. 418 */ 419 if (ni->type != AT_INDEX_ALLOCATION) { 420 /* If attribute is encrypted, deny access, just like NT4. */ 421 if (NInoEncrypted(ni)) { 422 BUG_ON(ni->type != AT_DATA); 423 err = -EACCES; 424 goto err_out; 425 } 426 /* Compressed data streams are handled in compress.c. */ 427 if (NInoNonResident(ni) && NInoCompressed(ni)) { 428 BUG_ON(ni->type != AT_DATA); 429 BUG_ON(ni->name_len); 430 return ntfs_read_compressed_block(page); 431 } 432 } 433 /* NInoNonResident() == NInoIndexAllocPresent() */ 434 if (NInoNonResident(ni)) { 435 /* Normal, non-resident data stream. */ 436 return ntfs_read_block(page); 437 } 438 /* 439 * Attribute is resident, implying it is not compressed or encrypted. 440 * This also means the attribute is smaller than an mft record and 441 * hence smaller than a page, so can simply zero out any pages with 442 * index above 0. Note the attribute can actually be marked compressed 443 * but if it is resident the actual data is not compressed so we are 444 * ok to ignore the compressed flag here. 445 */ 446 if (unlikely(page->index > 0)) { 447 zero_user(page, 0, PAGE_SIZE); 448 goto done; 449 } 450 if (!NInoAttr(ni)) 451 base_ni = ni; 452 else 453 base_ni = ni->ext.base_ntfs_ino; 454 /* Map, pin, and lock the mft record. */ 455 mrec = map_mft_record(base_ni); 456 if (IS_ERR(mrec)) { 457 err = PTR_ERR(mrec); 458 goto err_out; 459 } 460 /* 461 * If a parallel write made the attribute non-resident, drop the mft 462 * record and retry the read_folio. 463 */ 464 if (unlikely(NInoNonResident(ni))) { 465 unmap_mft_record(base_ni); 466 goto retry_readpage; 467 } 468 ctx = ntfs_attr_get_search_ctx(base_ni, mrec); 469 if (unlikely(!ctx)) { 470 err = -ENOMEM; 471 goto unm_err_out; 472 } 473 err = ntfs_attr_lookup(ni->type, ni->name, ni->name_len, 474 CASE_SENSITIVE, 0, NULL, 0, ctx); 475 if (unlikely(err)) 476 goto put_unm_err_out; 477 attr_len = le32_to_cpu(ctx->attr->data.resident.value_length); 478 read_lock_irqsave(&ni->size_lock, flags); 479 if (unlikely(attr_len > ni->initialized_size)) 480 attr_len = ni->initialized_size; 481 i_size = i_size_read(vi); 482 read_unlock_irqrestore(&ni->size_lock, flags); 483 if (unlikely(attr_len > i_size)) { 484 /* Race with shrinking truncate. */ 485 attr_len = i_size; 486 } 487 addr = kmap_atomic(page); 488 /* Copy the data to the page. */ 489 memcpy(addr, (u8*)ctx->attr + 490 le16_to_cpu(ctx->attr->data.resident.value_offset), 491 attr_len); 492 /* Zero the remainder of the page. */ 493 memset(addr + attr_len, 0, PAGE_SIZE - attr_len); 494 flush_dcache_page(page); 495 kunmap_atomic(addr); 496 put_unm_err_out: 497 ntfs_attr_put_search_ctx(ctx); 498 unm_err_out: 499 unmap_mft_record(base_ni); 500 done: 501 SetPageUptodate(page); 502 err_out: 503 unlock_page(page); 504 return err; 505 } 506 -- 0-DAY CI Kernel Test Service https://01.org/lkp