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, Julia Lawall <julia.lawall@inria.fr>
Subject: [djwong-xfs:timestats-hoist 169/464] fs/xfs/scrub/orphanage.c:495:9-16: Missing call to dput() at line 501.
Date: Wed, 1 May 2024 22:37:47 +0800	[thread overview]
Message-ID: <202405012240.dEcFooB6-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: "Darrick J. Wong" <darrick.wong@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git timestats-hoist
head:   506e7e6f31fbd22bbf6fb3ad2e66cd0d3761d2f2
commit: 5316671eec5d6d369121ccaaa21f8cbbad59600d [169/464] xfs: invalidate dentries for a file before moving it to the orphanage
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arm-randconfig-r063-20240501 (https://download.01.org/0day-ci/archive/20240501/202405012240.dEcFooB6-lkp@intel.com/config)
compiler: arm-linux-gnueabi-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: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202405012240.dEcFooB6-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/xfs/scrub/orphanage.c:495:9-16: Missing call to dput() at line 501.

vim +495 fs/xfs/scrub/orphanage.c

87aff44c9e2fa9 Darrick J. Wong 2024-01-09  460  
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  461  /*
5316671eec5d6d Darrick J. Wong 2024-04-10  462   * Invalidate all dentries for the name that was added to the orphanage
5316671eec5d6d Darrick J. Wong 2024-04-10  463   * directory, and all dentries pointing to the child inode that was moved.
5316671eec5d6d Darrick J. Wong 2024-04-10  464   *
5316671eec5d6d Darrick J. Wong 2024-04-10  465   * There should not be any positive entries for the name, since we've
5316671eec5d6d Darrick J. Wong 2024-04-10  466   * maintained our lock on the orphanage directory.
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  467   */
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  468  static void
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  469  xrep_adoption_zap_dcache(
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  470  	struct xrep_adoption	*adopt)
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  471  {
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  472  	struct qstr		qname = QSTR_INIT(adopt->xname->name,
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  473  						  adopt->xname->len);
5316671eec5d6d Darrick J. Wong 2024-04-10  474  	struct xfs_scrub	*sc = adopt->sc;
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  475  	struct dentry		*d_orphanage, *d_child;
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  476  
5316671eec5d6d Darrick J. Wong 2024-04-10  477  	/* Invalidate all dentries for the adoption name */
5316671eec5d6d Darrick J. Wong 2024-04-10  478  	d_orphanage = d_find_alias(VFS_I(sc->orphanage));
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  479  	if (!d_orphanage)
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  480  		return;
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  481  
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  482  	d_child = d_hash_and_lookup(d_orphanage, &qname);
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  483  	while (d_child != NULL) {
5316671eec5d6d Darrick J. Wong 2024-04-10  484  		trace_xrep_adoption_invalidate_child(sc->mp, d_child);
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  485  
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  486  		ASSERT(d_is_negative(d_child));
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  487  		d_invalidate(d_child);
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  488  		dput(d_child);
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  489  		d_child = d_lookup(d_orphanage, &qname);
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  490  	}
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  491  
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  492  	dput(d_orphanage);
5316671eec5d6d Darrick J. Wong 2024-04-10  493  
5316671eec5d6d Darrick J. Wong 2024-04-10  494  	/* Invalidate all the dentries pointing down to this file. */
5316671eec5d6d Darrick J. Wong 2024-04-10 @495  	while ((d_child = d_find_alias(VFS_I(sc->ip))) != NULL) {
5316671eec5d6d Darrick J. Wong 2024-04-10  496  		trace_xrep_adoption_invalidate_child(sc->mp, d_child);
5316671eec5d6d Darrick J. Wong 2024-04-10  497  
5316671eec5d6d Darrick J. Wong 2024-04-10  498  		d_invalidate(d_child);
5316671eec5d6d Darrick J. Wong 2024-04-10  499  		dput(d_child);
5316671eec5d6d Darrick J. Wong 2024-04-10  500  	}
87aff44c9e2fa9 Darrick J. Wong 2024-01-09 @501  }
87aff44c9e2fa9 Darrick J. Wong 2024-01-09  502  

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

                 reply	other threads:[~2024-05-01 14:38 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=202405012240.dEcFooB6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --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.