All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [dhowells-fs:netfs-writeback 17/22] fs/netfs/write_collect.c:110 netfs_writeback_lookup_folio() error: we previously assumed 'folio' could be null (see line 99)
Date: Sat, 23 Mar 2024 21:55:38 +0800	[thread overview]
Message-ID: <202403232142.egfToXYX-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: David Howells <dhowells@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-writeback
head:   6d4dafd8301ee8645d4814a7e75a9135acf67613
commit: 52ff5a10870495fafb8bdf0ee2e987d861b1b42c [17/22] netfs, 9p: Implement helpers for new write code
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: sparc64-randconfig-r081-20240323 (https://download.01.org/0day-ci/archive/20240323/202403232142.egfToXYX-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.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/202403232142.egfToXYX-lkp@intel.com/

smatch warnings:
fs/netfs/write_collect.c:110 netfs_writeback_lookup_folio() error: we previously assumed 'folio' could be null (see line 99)

vim +/folio +110 fs/netfs/write_collect.c

9a3702e1d161f5 David Howells 2024-03-18   81  
9a3702e1d161f5 David Howells 2024-03-18   82  /*
9a3702e1d161f5 David Howells 2024-03-18   83   * Get hold of a folio we have under writeback.  We don't want to get the
9a3702e1d161f5 David Howells 2024-03-18   84   * refcount on it.
9a3702e1d161f5 David Howells 2024-03-18   85   */
9a3702e1d161f5 David Howells 2024-03-18   86  static struct folio *netfs_writeback_lookup_folio(struct netfs_io_request *wreq, loff_t pos)
9a3702e1d161f5 David Howells 2024-03-18   87  {
9a3702e1d161f5 David Howells 2024-03-18   88  	XA_STATE(xas, &wreq->mapping->i_pages, pos / PAGE_SIZE);
9a3702e1d161f5 David Howells 2024-03-18   89  	struct folio *folio;
9a3702e1d161f5 David Howells 2024-03-18   90  
9a3702e1d161f5 David Howells 2024-03-18   91  	rcu_read_lock();
9a3702e1d161f5 David Howells 2024-03-18   92  
9a3702e1d161f5 David Howells 2024-03-18   93  	for (;;) {
9a3702e1d161f5 David Howells 2024-03-18   94  		xas_reset(&xas);
9a3702e1d161f5 David Howells 2024-03-18   95  		folio = xas_load(&xas);
9a3702e1d161f5 David Howells 2024-03-18   96  		if (xas_retry(&xas, folio))
9a3702e1d161f5 David Howells 2024-03-18   97  			continue;
9a3702e1d161f5 David Howells 2024-03-18   98  
9a3702e1d161f5 David Howells 2024-03-18  @99  		if (!folio || xa_is_value(folio))
9a3702e1d161f5 David Howells 2024-03-18  100  			kdebug("R=%08x: folio %lx (%llx) not present",
9a3702e1d161f5 David Howells 2024-03-18  101  			       wreq->debug_id, xas.xa_index, pos / PAGE_SIZE);
9a3702e1d161f5 David Howells 2024-03-18  102  		BUG_ON(!folio || xa_is_value(folio));
9a3702e1d161f5 David Howells 2024-03-18  103  
9a3702e1d161f5 David Howells 2024-03-18  104  		if (folio == xas_reload(&xas))
9a3702e1d161f5 David Howells 2024-03-18  105  			break;
9a3702e1d161f5 David Howells 2024-03-18  106  	}
9a3702e1d161f5 David Howells 2024-03-18  107  
9a3702e1d161f5 David Howells 2024-03-18  108  	rcu_read_unlock();
9a3702e1d161f5 David Howells 2024-03-18  109  
9a3702e1d161f5 David Howells 2024-03-18 @110  	if (WARN_ONCE(!folio_test_writeback(folio),
9a3702e1d161f5 David Howells 2024-03-18  111  		      "R=%08x: folio %lx is not under writeback\n",
9a3702e1d161f5 David Howells 2024-03-18  112  		      wreq->debug_id, folio->index)) {
9a3702e1d161f5 David Howells 2024-03-18  113  		trace_netfs_folio(folio, netfs_folio_trace_not_under_wback);
9a3702e1d161f5 David Howells 2024-03-18  114  	}
9a3702e1d161f5 David Howells 2024-03-18  115  	return folio;
9a3702e1d161f5 David Howells 2024-03-18  116  }
9a3702e1d161f5 David Howells 2024-03-18  117  

:::::: The code at line 110 was first introduced by commit
:::::: 9a3702e1d161f5b03a7b42122f9f693af1144fc8 netfs: New writeback implementation

:::::: TO: David Howells <dhowells@redhat.com>
:::::: CC: David Howells <dhowells@redhat.com>

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

                 reply	other threads:[~2024-03-23 13:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202403232142.egfToXYX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 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.