All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android14-6.1 1/1] fs/smb/server/vfs_cache.c:262:5-24: WARNING: atomic_dec_and_test variation before object free at line 274.
Date: Sun, 25 Oct 2026 20:56:43 +0100	[thread overview]
Message-ID: <202610252021.S32f9ApF-lkp@intel.com> (raw)

Hi Steve,

First bad commit (maybe != root cause):

tree:   https://android.googlesource.com/kernel/common android14-6.1
head:   2f0d864181b9acf801e9b51c345e11b6156b767a
commit: 29429a1f5871dbe54ee0da81bb12db8567f15379 [1/1] smb: move client and server files to common directory fs/smb
config: x86_64-randconfig-2100-20261025 (https://download.01.org/0day-ci/archive/20261025/202610252021.S32f9ApF-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610252021.S32f9ApF-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/smb/server/vfs_cache.c:262:5-24: WARNING: atomic_dec_and_test variation before object free at line 274.
   fs/smb/server/vfs_cache.c:213:5-24: WARNING: atomic_dec_and_test variation before object free at line 214.

vim +262 fs/smb/server/vfs_cache.c

f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  243  
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  244  static void __ksmbd_inode_close(struct ksmbd_file *fp)
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  245  {
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  246  	struct dentry *dir, *dentry;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  247  	struct ksmbd_inode *ci = fp->f_ci;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  248  	int err;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  249  	struct file *filp;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  250  
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  251  	filp = fp->filp;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  252  	if (ksmbd_stream_fd(fp) && (ci->m_flags & S_DEL_ON_CLS_STREAM)) {
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  253  		ci->m_flags &= ~S_DEL_ON_CLS_STREAM;
af34983e8315874 fs/ksmbd/vfs_cache.c Hyunchul Lee 2021-06-30  254  		err = ksmbd_vfs_remove_xattr(file_mnt_user_ns(filp),
af34983e8315874 fs/ksmbd/vfs_cache.c Hyunchul Lee 2021-06-30  255  					     filp->f_path.dentry,
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  256  					     fp->stream.name);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  257  		if (err)
bde1694aecdb535 fs/cifsd/vfs_cache.c Namjae Jeon  2021-06-28  258  			pr_err("remove xattr failed : %s\n",
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  259  			       fp->stream.name);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  260  	}
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  261  
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16 @262  	if (atomic_dec_and_test(&ci->m_count)) {
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  263  		write_lock(&ci->m_lock);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  264  		if (ci->m_flags & (S_DEL_ON_CLS | S_DEL_PENDING)) {
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  265  			dentry = filp->f_path.dentry;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  266  			dir = dentry->d_parent;
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  267  			ci->m_flags &= ~(S_DEL_ON_CLS | S_DEL_PENDING);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  268  			write_unlock(&ci->m_lock);
af34983e8315874 fs/ksmbd/vfs_cache.c Hyunchul Lee 2021-06-30  269  			ksmbd_vfs_unlink(file_mnt_user_ns(filp), dir, dentry);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  270  			write_lock(&ci->m_lock);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  271  		}
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  272  		write_unlock(&ci->m_lock);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  273  
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16 @274  		ksmbd_inode_free(ci);
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  275  	}
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  276  }
f44158485826c07 fs/cifsd/vfs_cache.c Namjae Jeon  2021-03-16  277  

:::::: The code at line 262 was first introduced by commit
:::::: f44158485826c076335d6860d35872271a83791d cifsd: add file operations

:::::: TO: Namjae Jeon <namjae.jeon@samsung.com>
:::::: CC: Steve French <stfrench@microsoft.com>

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

                 reply	other threads:[~2026-10-25 19:57 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=202610252021.S32f9ApF-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --cc=oe-kbuild-all@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.