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: [linux-next:master 1665/2828] fs/dcache.c:3015 d_splice_alias_ops() warn: inconsistent returns '&inode->i_lock'.
Date: Mon, 16 Jun 2025 22:03:27 +0800	[thread overview]
Message-ID: <202506162154.z0OrePAP-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Al Viro <viro@zeniv.linux.org.uk>
CC: Christian Brauner <brauner@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   050f8ad7b58d9079455af171ac279c4b9b828c11
commit: 790fa81b8c43cda9fe25c1b564d0afe3ddeeb370 [1665/2828] new helper: d_splice_alias_ops()
:::::: branch date: 8 hours ago
:::::: commit date: 6 days ago
config: x86_64-randconfig-161-20250616 (https://download.01.org/0day-ci/archive/20250616/202506162154.z0OrePAP-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/202506162154.z0OrePAP-lkp@intel.com/

smatch warnings:
fs/dcache.c:3015 d_splice_alias_ops() warn: inconsistent returns '&inode->i_lock'.

vim +3015 fs/dcache.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  2966  
790fa81b8c43cd Al Viro           2025-02-24  2967  struct dentry *d_splice_alias_ops(struct inode *inode, struct dentry *dentry,
790fa81b8c43cd Al Viro           2025-02-24  2968  				  const struct dentry_operations *ops)
3f70bd51cb4405 J. Bruce Fields   2014-02-18  2969  {
3f70bd51cb4405 J. Bruce Fields   2014-02-18  2970  	if (IS_ERR(inode))
3f70bd51cb4405 J. Bruce Fields   2014-02-18  2971  		return ERR_CAST(inode);
3f70bd51cb4405 J. Bruce Fields   2014-02-18  2972  
770bfad846ab66 David Howells     2006-08-22  2973  	BUG_ON(!d_unhashed(dentry));
770bfad846ab66 David Howells     2006-08-22  2974  
de689f5e366373 Al Viro           2016-03-09  2975  	if (!inode)
b5ae6b15bd73e3 Al Viro           2014-10-12  2976  		goto out;
de689f5e366373 Al Viro           2016-03-09  2977  
b96809173e94ea Al Viro           2016-04-11  2978  	security_d_instantiate(dentry, inode);
873feea09ebc98 Nicholas Piggin   2011-01-07  2979  	spin_lock(&inode->i_lock);
9eaef27b36a6b7 Trond Myklebust   2006-10-21  2980  	if (S_ISDIR(inode->i_mode)) {
b5ae6b15bd73e3 Al Viro           2014-10-12  2981  		struct dentry *new = __d_find_any_alias(inode);
b5ae6b15bd73e3 Al Viro           2014-10-12  2982  		if (unlikely(new)) {
a03e283bf5c3d4 Eric W. Biederman 2015-08-15  2983  			/* The reference to new ensures it remains an alias */
a03e283bf5c3d4 Eric W. Biederman 2015-08-15  2984  			spin_unlock(&inode->i_lock);
1836750115f20b Al Viro           2011-07-12  2985  			write_seqlock(&rename_lock);
b5ae6b15bd73e3 Al Viro           2014-10-12  2986  			if (unlikely(d_ancestor(new, dentry))) {
1836750115f20b Al Viro           2011-07-12  2987  				write_sequnlock(&rename_lock);
b5ae6b15bd73e3 Al Viro           2014-10-12  2988  				dput(new);
b5ae6b15bd73e3 Al Viro           2014-10-12  2989  				new = ERR_PTR(-ELOOP);
dd179946db2493 David Howells     2011-08-16  2990  				pr_warn_ratelimited(
dd179946db2493 David Howells     2011-08-16  2991  					"VFS: Lookup of '%s' in %s %s"
dd179946db2493 David Howells     2011-08-16  2992  					" would have caused loop\n",
dd179946db2493 David Howells     2011-08-16  2993  					dentry->d_name.name,
dd179946db2493 David Howells     2011-08-16  2994  					inode->i_sb->s_type->name,
dd179946db2493 David Howells     2011-08-16  2995  					inode->i_sb->s_id);
b5ae6b15bd73e3 Al Viro           2014-10-12  2996  			} else if (!IS_ROOT(new)) {
076515fc926793 Al Viro           2018-03-10  2997  				struct dentry *old_parent = dget(new->d_parent);
ef69f0506d8f3a Al Viro           2023-11-23  2998  				int err = __d_unalias(dentry, new);
b5ae6b15bd73e3 Al Viro           2014-10-12  2999  				write_sequnlock(&rename_lock);
b5ae6b15bd73e3 Al Viro           2014-10-12  3000  				if (err) {
b5ae6b15bd73e3 Al Viro           2014-10-12  3001  					dput(new);
b5ae6b15bd73e3 Al Viro           2014-10-12  3002  					new = ERR_PTR(err);
dd179946db2493 David Howells     2011-08-16  3003  				}
076515fc926793 Al Viro           2018-03-10  3004  				dput(old_parent);
b5ae6b15bd73e3 Al Viro           2014-10-12  3005  			} else {
b5ae6b15bd73e3 Al Viro           2014-10-12  3006  				__d_move(new, dentry, false);
b5ae6b15bd73e3 Al Viro           2014-10-12  3007  				write_sequnlock(&rename_lock);
9eaef27b36a6b7 Trond Myklebust   2006-10-21  3008  			}
b5ae6b15bd73e3 Al Viro           2014-10-12  3009  			iput(inode);
b5ae6b15bd73e3 Al Viro           2014-10-12  3010  			return new;
770bfad846ab66 David Howells     2006-08-22  3011  		}
b5ae6b15bd73e3 Al Viro           2014-10-12  3012  	}
b5ae6b15bd73e3 Al Viro           2014-10-12  3013  out:
790fa81b8c43cd Al Viro           2025-02-24  3014  	__d_add(dentry, inode, ops);
770bfad846ab66 David Howells     2006-08-22 @3015  	return NULL;
770bfad846ab66 David Howells     2006-08-22  3016  }
790fa81b8c43cd Al Viro           2025-02-24  3017  

:::::: The code at line 3015 was first introduced by commit
:::::: 770bfad846ab6628444428467b11fa6773ae9ea1 NFS: Add dentry materialisation op

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

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

                 reply	other threads:[~2025-06-16 14:04 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=202506162154.z0OrePAP-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.