linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Tyler Hicks <code@tyhicks.com>
Cc: oe-kbuild-all@lists.linux.dev,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	ecryptfs@vger.kernel.org, Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 03/10] ecryptfs: Convert ecryptfs_copy_up_encrypted_with_header() to take a folio
Date: Fri, 18 Oct 2024 11:43:59 +0800	[thread overview]
Message-ID: <202410181111.XVnnYVNa-lkp@intel.com> (raw)
In-Reply-To: <20241017151709.2713048-4-willy@infradead.org>

Hi Matthew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on v6.12-rc3]
[also build test WARNING on linus/master next-20241017]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Matthew-Wilcox-Oracle/ecryptfs-Convert-ecryptfs_writepage-to-ecryptfs_writepages/20241017-232033
base:   v6.12-rc3
patch link:    https://lore.kernel.org/r/20241017151709.2713048-4-willy%40infradead.org
patch subject: [PATCH 03/10] ecryptfs: Convert ecryptfs_copy_up_encrypted_with_header() to take a folio
config: x86_64-buildonly-randconfig-002-20241018 (https://download.01.org/0day-ci/archive/20241018/202410181111.XVnnYVNa-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241018/202410181111.XVnnYVNa-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410181111.XVnnYVNa-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ecryptfs/mmap.c:109: warning: Function parameter or struct member 'folio' not described in 'ecryptfs_copy_up_encrypted_with_header'
>> fs/ecryptfs/mmap.c:109: warning: Excess function parameter 'page' description in 'ecryptfs_copy_up_encrypted_with_header'


vim +109 fs/ecryptfs/mmap.c

f4e60e6b303bc4 Tyler Hicks             2010-02-11   79  
688a9f7cd824e7 Lee Jones               2021-03-30   80  /*
e77a56ddceeec8 Michael Halcrow         2007-02-12   81   *   Header Extent:
e77a56ddceeec8 Michael Halcrow         2007-02-12   82   *     Octets 0-7:        Unencrypted file size (big-endian)
e77a56ddceeec8 Michael Halcrow         2007-02-12   83   *     Octets 8-15:       eCryptfs special marker
e77a56ddceeec8 Michael Halcrow         2007-02-12   84   *     Octets 16-19:      Flags
e77a56ddceeec8 Michael Halcrow         2007-02-12   85   *      Octet 16:         File format version number (between 0 and 255)
e77a56ddceeec8 Michael Halcrow         2007-02-12   86   *      Octets 17-18:     Reserved
e77a56ddceeec8 Michael Halcrow         2007-02-12   87   *      Octet 19:         Bit 1 (lsb): Reserved
e77a56ddceeec8 Michael Halcrow         2007-02-12   88   *                        Bit 2: Encrypted?
e77a56ddceeec8 Michael Halcrow         2007-02-12   89   *                        Bits 3-8: Reserved
e77a56ddceeec8 Michael Halcrow         2007-02-12   90   *     Octets 20-23:      Header extent size (big-endian)
e77a56ddceeec8 Michael Halcrow         2007-02-12   91   *     Octets 24-25:      Number of header extents at front of file
e77a56ddceeec8 Michael Halcrow         2007-02-12   92   *                        (big-endian)
e77a56ddceeec8 Michael Halcrow         2007-02-12   93   *     Octet  26:         Begin RFC 2440 authentication token packet set
e77a56ddceeec8 Michael Halcrow         2007-02-12   94   */
237fead619984c Michael Halcrow         2006-10-04   95  
237fead619984c Michael Halcrow         2006-10-04   96  /**
bf12be1cc851cf Michael Halcrow         2007-10-16   97   * ecryptfs_copy_up_encrypted_with_header
bf12be1cc851cf Michael Halcrow         2007-10-16   98   * @page: Sort of a ``virtual'' representation of the encrypted lower
bf12be1cc851cf Michael Halcrow         2007-10-16   99   *        file. The actual lower file does not have the metadata in
bf12be1cc851cf Michael Halcrow         2007-10-16  100   *        the header. This is locked.
bf12be1cc851cf Michael Halcrow         2007-10-16  101   * @crypt_stat: The eCryptfs inode's cryptographic context
237fead619984c Michael Halcrow         2006-10-04  102   *
bf12be1cc851cf Michael Halcrow         2007-10-16  103   * The ``view'' is the version of the file that userspace winds up
bf12be1cc851cf Michael Halcrow         2007-10-16  104   * seeing, with the header information inserted.
237fead619984c Michael Halcrow         2006-10-04  105   */
bf12be1cc851cf Michael Halcrow         2007-10-16  106  static int
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  107) ecryptfs_copy_up_encrypted_with_header(struct folio *folio,
bf12be1cc851cf Michael Halcrow         2007-10-16  108  				       struct ecryptfs_crypt_stat *crypt_stat)
237fead619984c Michael Halcrow         2006-10-04 @109  {
bf12be1cc851cf Michael Halcrow         2007-10-16  110  	loff_t extent_num_in_page = 0;
09cbfeaf1a5a67 Kirill A. Shutemov      2016-04-01  111  	loff_t num_extents_per_page = (PAGE_SIZE
bf12be1cc851cf Michael Halcrow         2007-10-16  112  				       / crypt_stat->extent_size);
237fead619984c Michael Halcrow         2006-10-04  113  	int rc = 0;
237fead619984c Michael Halcrow         2006-10-04  114  
bf12be1cc851cf Michael Halcrow         2007-10-16  115  	while (extent_num_in_page < num_extents_per_page) {
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  116) 		loff_t view_extent_num = ((loff_t)folio->index
d6a13c17164fcc Michael Halcrow         2007-10-16  117  					   * num_extents_per_page)
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  118) 					  + extent_num_in_page;
cc11beffdf80ca Michael Halcrow         2008-02-06  119  		size_t num_header_extents_at_front =
fa3ef1cb4e6e99 Tyler Hicks             2010-02-11  120  			(crypt_stat->metadata_size / crypt_stat->extent_size);
e77a56ddceeec8 Michael Halcrow         2007-02-12  121  
cc11beffdf80ca Michael Halcrow         2008-02-06  122  		if (view_extent_num < num_header_extents_at_front) {
bf12be1cc851cf Michael Halcrow         2007-10-16  123  			/* This is a header extent */
e77a56ddceeec8 Michael Halcrow         2007-02-12  124  			char *page_virt;
e77a56ddceeec8 Michael Halcrow         2007-02-12  125  
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  126) 			page_virt = kmap_local_folio(folio, 0);
09cbfeaf1a5a67 Kirill A. Shutemov      2016-04-01  127  			memset(page_virt, 0, PAGE_SIZE);
bf12be1cc851cf Michael Halcrow         2007-10-16  128  			/* TODO: Support more than one header extent */
bf12be1cc851cf Michael Halcrow         2007-10-16  129  			if (view_extent_num == 0) {
157f1071354db1 Tyler Hicks             2010-02-11  130  				size_t written;
157f1071354db1 Tyler Hicks             2010-02-11  131  
e77a56ddceeec8 Michael Halcrow         2007-02-12  132  				rc = ecryptfs_read_xattr_region(
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  133) 					page_virt, folio->mapping->host);
f4e60e6b303bc4 Tyler Hicks             2010-02-11  134  				strip_xattr_flag(page_virt + 16, crypt_stat);
157f1071354db1 Tyler Hicks             2010-02-11  135  				ecryptfs_write_header_metadata(page_virt + 20,
157f1071354db1 Tyler Hicks             2010-02-11  136  							       crypt_stat,
157f1071354db1 Tyler Hicks             2010-02-11  137  							       &written);
e77a56ddceeec8 Michael Halcrow         2007-02-12  138  			}
e2393b8f3987c5 Fabio M. De Francesco   2023-04-26  139  			kunmap_local(page_virt);
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  140) 			flush_dcache_folio(folio);
e77a56ddceeec8 Michael Halcrow         2007-02-12  141  			if (rc) {
bf12be1cc851cf Michael Halcrow         2007-10-16  142  				printk(KERN_ERR "%s: Error reading xattr "
18d1dbf1d401e8 Harvey Harrison         2008-04-29  143  				       "region; rc = [%d]\n", __func__, rc);
e77a56ddceeec8 Michael Halcrow         2007-02-12  144  				goto out;
e77a56ddceeec8 Michael Halcrow         2007-02-12  145  			}
e77a56ddceeec8 Michael Halcrow         2007-02-12  146  		} else {
bf12be1cc851cf Michael Halcrow         2007-10-16  147  			/* This is an encrypted data extent */
bf12be1cc851cf Michael Halcrow         2007-10-16  148  			loff_t lower_offset =
cc11beffdf80ca Michael Halcrow         2008-02-06  149  				((view_extent_num * crypt_stat->extent_size)
fa3ef1cb4e6e99 Tyler Hicks             2010-02-11  150  				 - crypt_stat->metadata_size);
bf12be1cc851cf Michael Halcrow         2007-10-16  151  
bf12be1cc851cf Michael Halcrow         2007-10-16  152  			rc = ecryptfs_read_lower_page_segment(
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  153) 				&folio->page, (lower_offset >> PAGE_SHIFT),
09cbfeaf1a5a67 Kirill A. Shutemov      2016-04-01  154  				(lower_offset & ~PAGE_MASK),
f02b13c08673c2 Matthew Wilcox (Oracle  2024-10-17  155) 				crypt_stat->extent_size, folio->mapping->host);
e77a56ddceeec8 Michael Halcrow         2007-02-12  156  			if (rc) {
bf12be1cc851cf Michael Halcrow         2007-10-16  157  				printk(KERN_ERR "%s: Error attempting to read "
bf12be1cc851cf Michael Halcrow         2007-10-16  158  				       "extent at offset [%lld] in the lower "
18d1dbf1d401e8 Harvey Harrison         2008-04-29  159  				       "file; rc = [%d]\n", __func__,
bf12be1cc851cf Michael Halcrow         2007-10-16  160  				       lower_offset, rc);
e77a56ddceeec8 Michael Halcrow         2007-02-12  161  				goto out;
e77a56ddceeec8 Michael Halcrow         2007-02-12  162  			}
e77a56ddceeec8 Michael Halcrow         2007-02-12  163  		}
bf12be1cc851cf Michael Halcrow         2007-10-16  164  		extent_num_in_page++;
bf12be1cc851cf Michael Halcrow         2007-10-16  165  	}
bf12be1cc851cf Michael Halcrow         2007-10-16  166  out:
bf12be1cc851cf Michael Halcrow         2007-10-16  167  	return rc;
bf12be1cc851cf Michael Halcrow         2007-10-16  168  }
bf12be1cc851cf Michael Halcrow         2007-10-16  169  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-10-18  3:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 15:16 [PATCH 00/10] Convert ecryptfs to use folios Matthew Wilcox (Oracle)
2024-10-17 15:16 ` [PATCH 01/10] ecryptfs: Convert ecryptfs_writepage() to ecryptfs_writepages() Matthew Wilcox (Oracle)
2024-10-18  6:23   ` Pankaj Raghav (Samsung)
2024-10-25 17:56     ` Matthew Wilcox
2024-10-17 15:16 ` [PATCH 02/10] ecryptfs: Use a folio throughout ecryptfs_read_folio() Matthew Wilcox (Oracle)
2024-10-18  6:21   ` Pankaj Raghav (Samsung)
2024-10-25 18:50     ` Matthew Wilcox
2024-10-17 15:16 ` [PATCH 03/10] ecryptfs: Convert ecryptfs_copy_up_encrypted_with_header() to take a folio Matthew Wilcox (Oracle)
2024-10-18  3:43   ` kernel test robot [this message]
2024-10-18  6:33   ` Pankaj Raghav (Samsung)
2024-10-17 15:16 ` [PATCH 04/10] ecryptfs: Convert ecryptfs_read_lower_page_segment() " Matthew Wilcox (Oracle)
2024-10-17 15:17 ` [PATCH 05/10] ecryptfs: Convert ecryptfs_write() to use " Matthew Wilcox (Oracle)
2024-10-18  8:07   ` Pankaj Raghav (Samsung)
2024-10-17 15:17 ` [PATCH 06/10] ecryptfs: Convert ecryptfs_write_lower_page_segment() to take " Matthew Wilcox (Oracle)
2024-10-17 15:17 ` [PATCH 07/10] ecryptfs: Convert ecryptfs_encrypt_page() " Matthew Wilcox (Oracle)
2024-10-18  5:06   ` kernel test robot
2024-10-17 15:17 ` [PATCH 08/10] ecryptfs: Convert ecryptfs_decrypt_page() " Matthew Wilcox (Oracle)
2024-10-18  6:39   ` kernel test robot
2024-10-17 15:17 ` [PATCH 09/10] ecryptfs: Convert lower_offset_for_page() " Matthew Wilcox (Oracle)
2024-10-17 15:17 ` [PATCH 10/10] ecryptfs: Pass the folio index to crypt_extent() Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202410181111.XVnnYVNa-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=code@tyhicks.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).