llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [pali:cifs 18/21] fs/smb/client/reparse.c:398:15: warning: unused variable 'xattr_mode_val'
@ 2025-07-12 21:34 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-07-12 21:34 UTC (permalink / raw)
  To: Pali Rohár; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git cifs
head:   26ef98c6708ac92c515a4592138345359222b847
commit: 6b988dfe26bcb2e050b20f8903ef09be4fdf467b [18/21] cifs: Create native Window socket file compatible also with WSL subsystem
config: arm-randconfig-003-20250713 (https://download.01.org/0day-ci/archive/20250713/202507130548.2nwuvP3n-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 01c97b4953e87ae455bd4c41e3de3f0f0f29c61c)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250713/202507130548.2nwuvP3n-lkp@intel.com/reproduce)

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/202507130548.2nwuvP3n-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/smb/client/reparse.c:398:15: warning: unused variable 'xattr_mode_val' [-Wunused-variable]
     398 |         const __le64 xattr_mode_val = cpu_to_le64(mode);
         |                      ^~~~~~~~~~~~~~
>> fs/smb/client/reparse.c:399:23: warning: unused variable 'cifs_sb' [-Wunused-variable]
     399 |         struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
         |                              ^~~~~~~
   2 warnings generated.


vim +/xattr_mode_val +398 fs/smb/client/reparse.c

   381	
   382	static int create_native_socket(const unsigned int xid, struct inode *inode,
   383					struct dentry *dentry, struct cifs_tcon *tcon,
   384					const char *full_path, umode_t mode)
   385	{
   386		struct reparse_data_buffer buf = {
   387			.ReparseTag = cpu_to_le32(IO_REPARSE_TAG_AF_UNIX),
   388			.ReparseDataLength = cpu_to_le16(0),
   389		};
   390		struct cifs_open_info_data data = {
   391			.reparse_point = true,
   392			.reparse = { .tag = IO_REPARSE_TAG_AF_UNIX, .buf = &buf, },
   393		};
   394		struct kvec iov = {
   395			.iov_base = &buf,
   396			.iov_len = sizeof(buf),
   397		};
 > 398		const __le64 xattr_mode_val = cpu_to_le64(mode);
 > 399		struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
   400		struct inode *new;
   401		int rc = 0;
   402	
   403		new = tcon->ses->server->ops->create_reparse_inode(
   404					     &data, inode->i_sb, xid,
   405					     tcon, full_path, false, &iov, NULL);
   406		if (!IS_ERR(new))
   407			d_instantiate(dentry, new);
   408		else
   409			rc = PTR_ERR(new);
   410	
   411		/*
   412		 * Try to set also optional WSL EA $LXMOD but ignore errors.
   413		 * WSL socket and native Win32/NT sockets uses same reparse point
   414		 * tag IO_REPARSE_TAG_AF_UNIX. WSL subsystem additionally requires
   415		 * EA $LXMOD to be set with the S_IFSOCK value. So setting this EA
   416		 * allows native socket to be recognized also by WSL subsystem.
   417		 * Note that setting of both EAs and reparse points is not supported
   418		 * by NTFS filesystem on Windows 8 / Windows Server 2012 and always
   419		 * fails. So ignore failures from this set_EA call.
   420		 */
   421	#ifdef CONFIG_CIFS_XATTR
   422		if (!rc && tcon->ses->server->ops->set_EA &&
   423		    (le32_to_cpu(tcon->fsAttrInfo.Attributes) & FILE_SUPPORTS_EXTENDED_ATTRIBUTES))
   424			tcon->ses->server->ops->set_EA(xid, tcon, full_path,
   425						       true /* open reparse point */,
   426						       SMB2_WSL_XATTR_MODE,
   427						       &xattr_mode_val,
   428						       SMB2_WSL_XATTR_MODE_SIZE,
   429						       cifs_sb->local_nls, cifs_sb);
   430	#endif
   431	
   432		cifs_free_open_info(&data);
   433		return rc;
   434	}
   435	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-12 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 21:34 [pali:cifs 18/21] fs/smb/client/reparse.c:398:15: warning: unused variable 'xattr_mode_val' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).