Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Paulo Alcantara <pc@manguebit.com>, smfrench@gmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-cifs@vger.kernel.org, Paulo Alcantara <pc@manguebit.com>
Subject: Re: [PATCH 3/8] smb: client: allow creating symlinks via reparse points
Date: Sun, 26 Nov 2023 08:56:25 +0800	[thread overview]
Message-ID: <202311260838.nx5mkj1j-lkp@intel.com> (raw)
In-Reply-To: <20231125220813.30538-4-pc@manguebit.com>

Hi Paulo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cifs/for-next]
[also build test WARNING on next-20231124]
[cannot apply to linus/master v6.7-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paulo-Alcantara/smb-client-extend-smb2_compound_op-to-accept-more-commands/20231126-061137
base:   git://git.samba.org/sfrench/cifs-2.6.git for-next
patch link:    https://lore.kernel.org/r/20231125220813.30538-4-pc%40manguebit.com
patch subject: [PATCH 3/8] smb: client: allow creating symlinks via reparse points
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231126/202311260838.nx5mkj1j-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231126/202311260838.nx5mkj1j-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/202311260838.nx5mkj1j-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/smb/client/smb2ops.c:5267:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!IS_ERR(new))
               ^~~~~~~~~~~~
   fs/smb/client/smb2ops.c:5275:9: note: uninitialized use occurs here
           return rc;
                  ^~
   fs/smb/client/smb2ops.c:5267:2: note: remove the 'if' if its condition is always false
           if (!IS_ERR(new))
           ^~~~~~~~~~~~~~~~~
   fs/smb/client/smb2ops.c:5227:8: note: initialize the variable 'rc' to silence this warning
           int rc;
                 ^
                  = 0
   1 warning generated.


vim +5267 fs/smb/client/smb2ops.c

  5211	
  5212	static int smb2_create_reparse_symlink(const unsigned int xid,
  5213					       struct inode *inode,
  5214					       struct dentry *dentry,
  5215					       struct cifs_tcon *tcon,
  5216					       const char *full_path,
  5217					       const char *symname)
  5218	{
  5219		struct reparse_symlink_data_buffer *buf = NULL;
  5220		struct cifs_open_info_data data;
  5221		struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
  5222		struct inode *new;
  5223		struct kvec iov;
  5224		__le16 *path;
  5225		char *sym;
  5226		u16 len, plen;
  5227		int rc;
  5228	
  5229		sym = kstrdup(symname, GFP_KERNEL);
  5230		if (!sym)
  5231			return -ENOMEM;
  5232	
  5233		data = (struct cifs_open_info_data) {
  5234			.reparse_point = true,
  5235			.reparse = { .tag = IO_REPARSE_TAG_SYMLINK, },
  5236			.symlink_target = sym,
  5237		};
  5238	
  5239		path = cifs_convert_path_to_utf16(symname, cifs_sb);
  5240		if (!path) {
  5241			rc = -ENOMEM;
  5242			goto out;
  5243		}
  5244	
  5245		plen = 2 * UniStrnlen((wchar_t *)path, PATH_MAX);
  5246		len = sizeof(*buf) + plen * 2;
  5247		buf = kzalloc(len, GFP_KERNEL);
  5248		if (!buf) {
  5249			rc = -ENOMEM;
  5250			goto out;
  5251		}
  5252	
  5253		buf->ReparseTag = cpu_to_le32(IO_REPARSE_TAG_SYMLINK);
  5254		buf->ReparseDataLength = cpu_to_le16(len - sizeof(struct reparse_data_buffer));
  5255		buf->SubstituteNameOffset = cpu_to_le16(plen);
  5256		buf->SubstituteNameLength = cpu_to_le16(plen);
  5257		memcpy((u8 *)buf->PathBuffer + plen, path, plen);
  5258		buf->PrintNameOffset = 0;
  5259		buf->PrintNameLength = cpu_to_le16(plen);
  5260		memcpy(buf->PathBuffer, path, plen);
  5261		buf->Flags = cpu_to_le32(*symname != '/' ? SYMLINK_FLAG_RELATIVE : 0);
  5262	
  5263		iov.iov_base = buf;
  5264		iov.iov_len = len;
  5265		new = smb2_get_reparse_inode(&data, inode->i_sb, xid,
  5266					     tcon, full_path, &iov);
> 5267		if (!IS_ERR(new))
  5268			d_instantiate(dentry, new);
  5269		else
  5270			rc = PTR_ERR(new);
  5271	out:
  5272		kfree(path);
  5273		cifs_free_open_info(&data);
  5274		kfree(buf);
  5275		return rc;
  5276	}
  5277	

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

  reply	other threads:[~2023-11-26  0:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25 22:08 [PATCH 0/8] reparse points work Paulo Alcantara
2023-11-25 22:08 ` [PATCH 1/8] smb: client: extend smb2_compound_op() to accept more commands Paulo Alcantara
2023-11-25 22:08 ` [PATCH 2/8] smb: client: allow creating special files via reparse points Paulo Alcantara
2023-11-26  0:14   ` kernel test robot
2023-11-25 22:08 ` [PATCH 3/8] smb: client: allow creating symlinks " Paulo Alcantara
2023-11-26  0:56   ` kernel test robot [this message]
2023-11-25 22:08 ` [PATCH 4/8] smb: client: optimise reparse point querying Paulo Alcantara
2023-11-25 22:08 ` [PATCH 5/8] smb: client: fix renaming of reparse points Paulo Alcantara
2023-11-25 22:08 ` [PATCH 6/8] smb: client: fix hardlinking " Paulo Alcantara
2023-11-25 22:08 ` [PATCH 7/8] smb: client: cleanup smb2_query_reparse_point() Paulo Alcantara
2023-11-25 22:08 ` [PATCH 8/8] smb: client: optimise dentry revalidation for reparse points Paulo Alcantara

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=202311260838.nx5mkj1j-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pc@manguebit.com \
    --cc=smfrench@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox