All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 08/12] nilfs2: convert checkpoint file to be folio-based
@ 2024-10-26 11:33 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-10-26 11:33 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20241024092602.13395-9-konishi.ryusuke@gmail.com>
References: <20241024092602.13395-9-konishi.ryusuke@gmail.com>
TO: Ryusuke Konishi <konishi.ryusuke@gmail.com>

Hi Ryusuke,

kernel test robot noticed the following build warnings:

[auto build test WARNING on konis-nilfs2/upstream]
[also build test WARNING on linus/master v6.12-rc4 next-20241025]
[cannot apply to akpm-mm/mm-everything]
[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/Ryusuke-Konishi/nilfs2-convert-segment-buffer-to-be-folio-based/20241024-173025
base:   https://github.com/konis/nilfs2 upstream
patch link:    https://lore.kernel.org/r/20241024092602.13395-9-konishi.ryusuke%40gmail.com
patch subject: [PATCH 08/12] nilfs2: convert checkpoint file to be folio-based
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-141-20241026 (https://download.01.org/0day-ci/archive/20241026/202410261934.HqwZEx2G-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202410261934.HqwZEx2G-lkp@intel.com/

New smatch warnings:
fs/nilfs2/cpfile.c:662 nilfs_cpfile_do_get_ssinfo() warn: passing freed memory 'bh'

Old smatch warnings:
fs/nilfs2/cpfile.c:687 nilfs_cpfile_do_get_ssinfo() warn: passing freed memory 'bh'

vim +/bh +662 fs/nilfs2/cpfile.c

29619809727a4e Koji Sato       2009-04-06  622  
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  623  static ssize_t nilfs_cpfile_do_get_ssinfo(struct inode *cpfile, __u64 *cnop,
0c6c44cb9f93f7 Ryusuke Konishi 2016-05-23  624  					  void *buf, unsigned int cisz,
0c6c44cb9f93f7 Ryusuke Konishi 2016-05-23  625  					  size_t nci)
29619809727a4e Koji Sato       2009-04-06  626  {
29619809727a4e Koji Sato       2009-04-06  627  	struct buffer_head *bh;
29619809727a4e Koji Sato       2009-04-06  628  	struct nilfs_cpfile_header *header;
29619809727a4e Koji Sato       2009-04-06  629  	struct nilfs_checkpoint *cp;
003ff182fddde0 Ryusuke Konishi 2009-05-12  630  	struct nilfs_cpinfo *ci = buf;
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  631  	__u64 curr = *cnop, next;
29619809727a4e Koji Sato       2009-04-06  632  	unsigned long curr_blkoff, next_blkoff;
02954476a4ce12 Ryusuke Konishi 2024-10-24  633  	size_t offset;
7fa10d20012296 Ryusuke Konishi 2009-04-06  634  	int n = 0, ret;
29619809727a4e Koji Sato       2009-04-06  635  
29619809727a4e Koji Sato       2009-04-06  636  	down_read(&NILFS_MDT(cpfile)->mi_sem);
29619809727a4e Koji Sato       2009-04-06  637  
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  638  	if (curr == 0) {
29619809727a4e Koji Sato       2009-04-06  639  		ret = nilfs_cpfile_get_header_block(cpfile, &bh);
29619809727a4e Koji Sato       2009-04-06  640  		if (ret < 0)
29619809727a4e Koji Sato       2009-04-06  641  			goto out;
02954476a4ce12 Ryusuke Konishi 2024-10-24  642  		header = kmap_local_folio(bh->b_folio, 0);
29619809727a4e Koji Sato       2009-04-06  643  		curr = le64_to_cpu(header->ch_snapshot_list.ssl_next);
02954476a4ce12 Ryusuke Konishi 2024-10-24  644  		kunmap_local(header);
29619809727a4e Koji Sato       2009-04-06  645  		brelse(bh);
29619809727a4e Koji Sato       2009-04-06  646  		if (curr == 0) {
29619809727a4e Koji Sato       2009-04-06  647  			ret = 0;
29619809727a4e Koji Sato       2009-04-06  648  			goto out;
29619809727a4e Koji Sato       2009-04-06  649  		}
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  650  	} else if (unlikely(curr == ~(__u64)0)) {
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  651  		ret = 0;
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  652  		goto out;
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  653  	}
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  654  
29619809727a4e Koji Sato       2009-04-06  655  	curr_blkoff = nilfs_cpfile_get_blkoff(cpfile, curr);
29619809727a4e Koji Sato       2009-04-06  656  	ret = nilfs_cpfile_get_checkpoint_block(cpfile, curr, 0, &bh);
7fa10d20012296 Ryusuke Konishi 2009-04-06  657  	if (unlikely(ret < 0)) {
7fa10d20012296 Ryusuke Konishi 2009-04-06  658  		if (ret == -ENOENT)
7fa10d20012296 Ryusuke Konishi 2009-04-06  659  			ret = 0; /* No snapshots (started from a hole block) */
29619809727a4e Koji Sato       2009-04-06  660  		goto out;
7fa10d20012296 Ryusuke Konishi 2009-04-06  661  	}
02954476a4ce12 Ryusuke Konishi 2024-10-24 @662  	offset = nilfs_cpfile_checkpoint_offset(cpfile, curr, bh);
02954476a4ce12 Ryusuke Konishi 2024-10-24  663  	cp = kmap_local_folio(bh->b_folio, offset);
7fa10d20012296 Ryusuke Konishi 2009-04-06  664  	while (n < nci) {
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  665  		curr = ~(__u64)0; /* Terminator */
7fa10d20012296 Ryusuke Konishi 2009-04-06  666  		if (unlikely(nilfs_checkpoint_invalid(cp) ||
7fa10d20012296 Ryusuke Konishi 2009-04-06  667  			     !nilfs_checkpoint_snapshot(cp)))
29619809727a4e Koji Sato       2009-04-06  668  			break;
003ff182fddde0 Ryusuke Konishi 2009-05-12  669  		nilfs_cpfile_checkpoint_to_cpinfo(cpfile, cp, ci);
003ff182fddde0 Ryusuke Konishi 2009-05-12  670  		ci = (void *)ci + cisz;
003ff182fddde0 Ryusuke Konishi 2009-05-12  671  		n++;
7fa10d20012296 Ryusuke Konishi 2009-04-06  672  		next = le64_to_cpu(cp->cp_snapshot_list.ssl_next);
7fa10d20012296 Ryusuke Konishi 2009-04-06  673  		if (next == 0)
7fa10d20012296 Ryusuke Konishi 2009-04-06  674  			break; /* reach end of the snapshot list */
7fa10d20012296 Ryusuke Konishi 2009-04-06  675  
02954476a4ce12 Ryusuke Konishi 2024-10-24  676  		kunmap_local(cp);
29619809727a4e Koji Sato       2009-04-06  677  		next_blkoff = nilfs_cpfile_get_blkoff(cpfile, next);
29619809727a4e Koji Sato       2009-04-06  678  		if (curr_blkoff != next_blkoff) {
29619809727a4e Koji Sato       2009-04-06  679  			brelse(bh);
29619809727a4e Koji Sato       2009-04-06  680  			ret = nilfs_cpfile_get_checkpoint_block(cpfile, next,
29619809727a4e Koji Sato       2009-04-06  681  								0, &bh);
7fa10d20012296 Ryusuke Konishi 2009-04-06  682  			if (unlikely(ret < 0)) {
7fa10d20012296 Ryusuke Konishi 2009-04-06  683  				WARN_ON(ret == -ENOENT);
29619809727a4e Koji Sato       2009-04-06  684  				goto out;
7fa10d20012296 Ryusuke Konishi 2009-04-06  685  			}
29619809727a4e Koji Sato       2009-04-06  686  		}
02954476a4ce12 Ryusuke Konishi 2024-10-24  687  		offset = nilfs_cpfile_checkpoint_offset(cpfile, next, bh);
02954476a4ce12 Ryusuke Konishi 2024-10-24  688  		cp = kmap_local_folio(bh->b_folio, offset);
29619809727a4e Koji Sato       2009-04-06  689  		curr = next;
29619809727a4e Koji Sato       2009-04-06  690  		curr_blkoff = next_blkoff;
29619809727a4e Koji Sato       2009-04-06  691  	}
02954476a4ce12 Ryusuke Konishi 2024-10-24  692  	kunmap_local(cp);
29619809727a4e Koji Sato       2009-04-06  693  	brelse(bh);
b028fcfc4cd198 Ryusuke Konishi 2009-04-06  694  	*cnop = curr;
29619809727a4e Koji Sato       2009-04-06  695  	ret = n;
29619809727a4e Koji Sato       2009-04-06  696  
29619809727a4e Koji Sato       2009-04-06  697   out:
29619809727a4e Koji Sato       2009-04-06  698  	up_read(&NILFS_MDT(cpfile)->mi_sem);
29619809727a4e Koji Sato       2009-04-06  699  	return ret;
29619809727a4e Koji Sato       2009-04-06  700  }
29619809727a4e Koji Sato       2009-04-06  701  

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH 00/12] nilfs2: Finish folio conversion
@ 2024-10-24  9:25 Ryusuke Konishi
  2024-10-24  9:25 ` [PATCH 08/12] nilfs2: convert checkpoint file to be folio-based Ryusuke Konishi
  0 siblings, 1 reply; 2+ messages in thread
From: Ryusuke Konishi @ 2024-10-24  9:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Matthew Wilcox, linux-nilfs, linux-kernel, linux-fsdevel

Andrew, please queue this series for the next cycle.

This series converts all remaining page structure references in nilfs2
to folio-based, except for nilfs_copy_buffer function, which was
converted to use folios in advance for cross-fs page flags cleanup.

This prioritizes folio conversion, and does not include buffer head
reference reduction, nor does it support for block sizes larger than
the system page size.

The first eight patches in this series mainly convert each of the
nilfs2-specific metadata implementations to use folios.  The last four
patches, by Matthew Wilcox, eliminate aops writepage callbacks and
convert the remaining page structure references to folio-based.  This
part reflects some corrections to the patch series posted by Matthew.

It has passed operation checks and load tests with different block
sizes on multiple environments, including 32-bit kernel, and is
sufficiently stable.

Thanks,
Ryusuke Konishi


Matthew Wilcox (Oracle) (4):
  nilfs2: Remove nilfs_writepage
  nilfs2: Convert nilfs_page_count_clean_buffers() to take a folio
  nilfs2: Convert nilfs_recovery_copy_block() to take a folio
  nilfs2: Convert metadata aops from writepage to writepages

Ryusuke Konishi (8):
  nilfs2: convert segment buffer to be folio-based
  nilfs2: convert common metadata file code to be folio-based
  nilfs2: convert segment usage file to be folio-based
  nilfs2: convert persistent object allocator to be folio-based
  nilfs2: convert inode file to be folio-based
  nilfs2: convert DAT file to be folio-based
  nilfs2: remove nilfs_palloc_block_get_entry()
  nilfs2: convert checkpoint file to be folio-based

 fs/nilfs2/alloc.c    | 148 +++++++++--------
 fs/nilfs2/alloc.h    |   4 +-
 fs/nilfs2/cpfile.c   | 383 +++++++++++++++++++++++--------------------
 fs/nilfs2/dat.c      |  98 +++++------
 fs/nilfs2/dir.c      |   2 +-
 fs/nilfs2/ifile.c    |  10 +-
 fs/nilfs2/ifile.h    |   4 +-
 fs/nilfs2/inode.c    |  35 +---
 fs/nilfs2/mdt.c      |  40 +++--
 fs/nilfs2/page.c     |   4 +-
 fs/nilfs2/page.h     |   4 +-
 fs/nilfs2/recovery.c |  17 +-
 fs/nilfs2/segbuf.c   |  17 +-
 fs/nilfs2/sufile.c   | 160 +++++++++---------
 14 files changed, 485 insertions(+), 441 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-26 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26 11:33 [PATCH 08/12] nilfs2: convert checkpoint file to be folio-based kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-10-24  9:25 [PATCH 00/12] nilfs2: Finish folio conversion Ryusuke Konishi
2024-10-24  9:25 ` [PATCH 08/12] nilfs2: convert checkpoint file to be folio-based Ryusuke Konishi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.