Skip to content

Commit 8cf8b5a

Browse files
dhowellstorvalds
authored andcommitted
cifs: Fix undefined variables
Fix a couple of undefined variables introduced by the patch to fix tearing on ->remote_i_size and ->zero_point. For some reason, make W=1 with gcc doesn't give undefined variable warnings (but clang does). Fixes: 2c8f474 ("netfs: Fix potential for tearing in ->remote_i_size and ->zero_point") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202605031459.eX5UbO3K-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202605021450.ca5QGqLH-lkp@intel.com/ cc: Steve French <sfrench@samba.org> cc: Paulo Alcantara <pc@manguebit.org> cc: Matthew Wilcox <willy@infradead.org> cc: Christian Brauner <brauner@kernel.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4d3a2a4 commit 8cf8b5a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/smb/client/cifsfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
13041304
struct cifsFileInfo *smb_file_src = src_file->private_data;
13051305
struct cifsFileInfo *smb_file_target = dst_file->private_data;
13061306
struct cifs_tcon *target_tcon, *src_tcon;
1307-
unsigned long long i_size, old_size, new_size, zero_point;
1307+
unsigned long long i_size, new_size;
13081308
unsigned long long destend, fstart, fend;
13091309
unsigned int xid;
13101310
int rc;
@@ -1372,7 +1372,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
13721372
goto unlock;
13731373

13741374
spin_lock(&target_inode->i_lock);
1375-
if (fend > zero_point)
1375+
if (fend > target_cifsi->netfs._zero_point)
13761376
netfs_write_zero_point(target_inode, fend + 1);
13771377
i_size = target_inode->i_size;
13781378
spin_unlock(&target_inode->i_lock);
@@ -1387,7 +1387,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
13871387
if (target_tcon->ses->server->ops->duplicate_extents) {
13881388
rc = target_tcon->ses->server->ops->duplicate_extents(xid,
13891389
smb_file_src, smb_file_target, off, len, destoff);
1390-
if (rc == 0 && new_size > old_size) {
1390+
if (rc == 0 && new_size > i_size) {
13911391
truncate_setsize(target_inode, new_size);
13921392
fscache_resize_cookie(cifs_inode_cookie(target_inode),
13931393
new_size);

0 commit comments

Comments
 (0)