Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ronnie Sahlberg <lsahlber@redhat.com>,
	linux-cifs <linux-cifs@vger.kernel.org>
Cc: kbuild-all@lists.01.org, Steve French <smfrench@gmail.com>
Subject: Re: [PATCH] cifs: truncate the inode and mapping when we simulate fcollapse
Date: Tue, 22 Feb 2022 20:08:02 +0800	[thread overview]
Message-ID: <202202221941.P3ofWs7j-lkp@intel.com> (raw)
In-Reply-To: <20220222053521.289668-1-lsahlber@redhat.com>

Hi Ronnie,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on cifs/for-next]
[also build test WARNING on v5.17-rc5 next-20220217]
[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]

url:    https://github.com/0day-ci/linux/commits/Ronnie-Sahlberg/cifs-truncate-the-inode-and-mapping-when-we-simulate-fcollapse/20220222-133724
base:   git://git.samba.org/sfrench/cifs-2.6.git for-next
config: i386-randconfig-s001-20220221 (https://download.01.org/0day-ci/archive/20220222/202202221941.P3ofWs7j-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/a29e6f21f30f32afbc6cf397a34ca2904038d759
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ronnie-Sahlberg/cifs-truncate-the-inode-and-mapping-when-we-simulate-fcollapse/20220222-133724
        git checkout a29e6f21f30f32afbc6cf397a34ca2904038d759
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> fs/cifs/smb2ops.c:3920:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le64 [addressable] [assigned] [usertype] eof @@     got long long @@
   fs/cifs/smb2ops.c:3920:13: sparse:     expected restricted __le64 [addressable] [assigned] [usertype] eof
   fs/cifs/smb2ops.c:3920:13: sparse:     got long long
>> fs/cifs/smb2ops.c:3921:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] server_eof @@     got restricted __le64 [addressable] [assigned] [usertype] eof @@
   fs/cifs/smb2ops.c:3921:27: sparse:     expected unsigned long long [usertype] server_eof
   fs/cifs/smb2ops.c:3921:27: sparse:     got restricted __le64 [addressable] [assigned] [usertype] eof
>> fs/cifs/smb2ops.c:3922:33: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected long long [usertype] newsize @@     got restricted __le64 [addressable] [assigned] [usertype] eof @@
   fs/cifs/smb2ops.c:3922:33: sparse:     expected long long [usertype] newsize
   fs/cifs/smb2ops.c:3922:33: sparse:     got restricted __le64 [addressable] [assigned] [usertype] eof
>> fs/cifs/smb2ops.c:3923:57: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected long long [usertype] new_size @@     got restricted __le64 [addressable] [assigned] [usertype] eof @@
   fs/cifs/smb2ops.c:3923:57: sparse:     expected long long [usertype] new_size
   fs/cifs/smb2ops.c:3923:57: sparse:     got restricted __le64 [addressable] [assigned] [usertype] eof

vim +3920 fs/cifs/smb2ops.c

  3885	
  3886	static long smb3_collapse_range(struct file *file, struct cifs_tcon *tcon,
  3887				    loff_t off, loff_t len)
  3888	{
  3889		int rc;
  3890		unsigned int xid;
  3891		struct inode *inode;
  3892		struct cifsFileInfo *cfile = file->private_data;
  3893		struct cifsInodeInfo *cifsi;
  3894		__le64 eof;
  3895	
  3896		xid = get_xid();
  3897	
  3898		inode = d_inode(cfile->dentry);
  3899		cifsi = CIFS_I(inode);
  3900	
  3901		if (off >= i_size_read(inode) ||
  3902		    off + len >= i_size_read(inode)) {
  3903			rc = -EINVAL;
  3904			goto out;
  3905		}
  3906	
  3907		rc = smb2_copychunk_range(xid, cfile, cfile, off + len,
  3908					  i_size_read(inode) - off - len, off);
  3909		if (rc < 0)
  3910			goto out;
  3911	
  3912		eof = cpu_to_le64(i_size_read(inode) - len);
  3913		rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
  3914				  cfile->fid.volatile_fid, cfile->pid, &eof);
  3915		if (rc < 0)
  3916			goto out;
  3917	
  3918		rc = 0;
  3919	
> 3920		eof = i_size_read(inode) - len;
> 3921		cifsi->server_eof = eof;
> 3922		truncate_setsize(inode, eof);
> 3923		fscache_resize_cookie(cifs_inode_cookie(inode), eof);
  3924	 out:
  3925		free_xid(xid);
  3926		return rc;
  3927	}
  3928	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  reply	other threads:[~2022-02-22 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  5:35 [PATCH] cifs: truncate the inode and mapping when we simulate fcollapse Ronnie Sahlberg
2022-02-22 12:08 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-23  1:14 Ronnie Sahlberg
2022-02-23  2:44 ` Steve French

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=202202221941.P3ofWs7j-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=lsahlber@redhat.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