Re: [PATCH 07/10] ecryptfs: Convert ecryptfs_encrypt_page() to take a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-8-willy%40infradead.org
patch subject: [PATCH 07/10] ecryptfs: Convert ecryptfs_encrypt_page() to take a folio
config: x86_64-buildonly-randconfig-002-20241018 (https://download.01.org/0day-ci/archive/20241018/202410181219.HUGM3U13-lkp@xxxxxxxxx/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/202410181219.HUGM3U13-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410181219.HUGM3U13-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> fs/ecryptfs/crypto.c:410: warning: Function parameter or struct member 'folio' not described in 'ecryptfs_encrypt_page'
>> fs/ecryptfs/crypto.c:410: warning: Excess function parameter 'page' description in 'ecryptfs_encrypt_page'


vim +410 fs/ecryptfs/crypto.c

237fead619984c Michael Halcrow         2006-10-04  392  
237fead619984c Michael Halcrow         2006-10-04  393  /**
0216f7f7921759 Michael Halcrow         2007-10-16  394   * ecryptfs_encrypt_page
0216f7f7921759 Michael Halcrow         2007-10-16  395   * @page: Page mapped from the eCryptfs inode for the file; contains
0216f7f7921759 Michael Halcrow         2007-10-16  396   *        decrypted content that needs to be encrypted (to a temporary
0216f7f7921759 Michael Halcrow         2007-10-16  397   *        page; not in place) and written out to the lower file
237fead619984c Michael Halcrow         2006-10-04  398   *
0216f7f7921759 Michael Halcrow         2007-10-16  399   * Encrypt an eCryptfs page. This is done on a per-extent basis. Note
237fead619984c Michael Halcrow         2006-10-04  400   * that eCryptfs pages may straddle the lower pages -- for instance,
237fead619984c Michael Halcrow         2006-10-04  401   * if the file was created on a machine with an 8K page size
237fead619984c Michael Halcrow         2006-10-04  402   * (resulting in an 8K header), and then the file is copied onto a
237fead619984c Michael Halcrow         2006-10-04  403   * host with a 32K page size, then when reading page 0 of the eCryptfs
237fead619984c Michael Halcrow         2006-10-04  404   * file, 24K of page 0 of the lower file will be read and decrypted,
237fead619984c Michael Halcrow         2006-10-04  405   * and then 8K of page 1 of the lower file will be read and decrypted.
237fead619984c Michael Halcrow         2006-10-04  406   *
237fead619984c Michael Halcrow         2006-10-04  407   * Returns zero on success; negative on error
237fead619984c Michael Halcrow         2006-10-04  408   */
722a8483fde078 Matthew Wilcox (Oracle  2024-10-17  409) int ecryptfs_encrypt_page(struct folio *folio)
237fead619984c Michael Halcrow         2006-10-04 @410  {
0216f7f7921759 Michael Halcrow         2007-10-16  411  	struct inode *ecryptfs_inode;
237fead619984c Michael Halcrow         2006-10-04  412  	struct ecryptfs_crypt_stat *crypt_stat;
7fcba054373d5d Eric Sandeen            2008-07-28  413  	char *enc_extent_virt;
7fcba054373d5d Eric Sandeen            2008-07-28  414  	struct page *enc_extent_page = NULL;
0216f7f7921759 Michael Halcrow         2007-10-16  415  	loff_t extent_offset;
0f89617623fed9 Tyler Hicks             2013-04-15  416  	loff_t lower_offset;
237fead619984c Michael Halcrow         2006-10-04  417  	int rc = 0;
237fead619984c Michael Halcrow         2006-10-04  418  
722a8483fde078 Matthew Wilcox (Oracle  2024-10-17  419) 	ecryptfs_inode = folio->mapping->host;
0216f7f7921759 Michael Halcrow         2007-10-16  420  	crypt_stat =
0216f7f7921759 Michael Halcrow         2007-10-16  421  		&(ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat);
13a791b4e63eb0 Tyler Hicks             2009-04-13  422  	BUG_ON(!(crypt_stat->flags & ECRYPTFS_ENCRYPTED));
7fcba054373d5d Eric Sandeen            2008-07-28  423  	enc_extent_page = alloc_page(GFP_USER);
7fcba054373d5d Eric Sandeen            2008-07-28  424  	if (!enc_extent_page) {
237fead619984c Michael Halcrow         2006-10-04  425  		rc = -ENOMEM;
0216f7f7921759 Michael Halcrow         2007-10-16  426  		ecryptfs_printk(KERN_ERR, "Error allocating memory for "
0216f7f7921759 Michael Halcrow         2007-10-16  427  				"encrypted extent\n");
237fead619984c Michael Halcrow         2006-10-04  428  		goto out;
237fead619984c Michael Halcrow         2006-10-04  429  	}
0f89617623fed9 Tyler Hicks             2013-04-15  430  
0216f7f7921759 Michael Halcrow         2007-10-16  431  	for (extent_offset = 0;
09cbfeaf1a5a67 Kirill A. Shutemov      2016-04-01  432  	     extent_offset < (PAGE_SIZE / crypt_stat->extent_size);
0216f7f7921759 Michael Halcrow         2007-10-16  433  	     extent_offset++) {
722a8483fde078 Matthew Wilcox (Oracle  2024-10-17  434) 		rc = crypt_extent(crypt_stat, enc_extent_page,
722a8483fde078 Matthew Wilcox (Oracle  2024-10-17  435) 				folio_page(folio, 0), extent_offset, ENCRYPT);
237fead619984c Michael Halcrow         2006-10-04  436  		if (rc) {
0216f7f7921759 Michael Halcrow         2007-10-16  437  			printk(KERN_ERR "%s: Error encrypting extent; "
18d1dbf1d401e8 Harvey Harrison         2008-04-29  438  			       "rc = [%d]\n", __func__, rc);
237fead619984c Michael Halcrow         2006-10-04  439  			goto out;
237fead619984c Michael Halcrow         2006-10-04  440  		}
237fead619984c Michael Halcrow         2006-10-04  441  	}
0216f7f7921759 Michael Halcrow         2007-10-16  442  
722a8483fde078 Matthew Wilcox (Oracle  2024-10-17  443) 	lower_offset = lower_offset_for_page(crypt_stat, &folio->page);
8b70deb8ca901d Fabio M. De Francesco   2023-04-26  444  	enc_extent_virt = kmap_local_page(enc_extent_page);
0f89617623fed9 Tyler Hicks             2013-04-15  445  	rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, lower_offset,
09cbfeaf1a5a67 Kirill A. Shutemov      2016-04-01  446  				  PAGE_SIZE);
8b70deb8ca901d Fabio M. De Francesco   2023-04-26  447  	kunmap_local(enc_extent_virt);
0216f7f7921759 Michael Halcrow         2007-10-16  448  	if (rc < 0) {
0f89617623fed9 Tyler Hicks             2013-04-15  449  		ecryptfs_printk(KERN_ERR,
0f89617623fed9 Tyler Hicks             2013-04-15  450  			"Error attempting to write lower page; rc = [%d]\n",
0216f7f7921759 Michael Halcrow         2007-10-16  451  			rc);
237fead619984c Michael Halcrow         2006-10-04  452  		goto out;
237fead619984c Michael Halcrow         2006-10-04  453  	}
237fead619984c Michael Halcrow         2006-10-04  454  	rc = 0;
0216f7f7921759 Michael Halcrow         2007-10-16  455  out:
7fcba054373d5d Eric Sandeen            2008-07-28  456  	if (enc_extent_page) {
7fcba054373d5d Eric Sandeen            2008-07-28  457  		__free_page(enc_extent_page);
7fcba054373d5d Eric Sandeen            2008-07-28  458  	}
0216f7f7921759 Michael Halcrow         2007-10-16  459  	return rc;
0216f7f7921759 Michael Halcrow         2007-10-16  460  }
0216f7f7921759 Michael Halcrow         2007-10-16  461  

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




[Index of Archives]     [Linux Crypto]     [Device Mapper Crypto]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux