* [PATCH] cifs: Fix undefined variables
@ 2026-05-18 21:13 David Howells
2026-05-19 0:54 ` Linus Torvalds
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2026-05-18 21:13 UTC (permalink / raw)
To: Steve French
Cc: dhowells, Nathan Chancellor, kernel test robot, Paulo Alcantara,
Matthew Wilcox, Christian Brauner, Linus Torvalds, linux-cifs,
netfs, linux-fsdevel, linux-kernel
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: 2c8f4742bb76 ("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
---
fs/smb/client/cifsfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index feac491c5070..f557eb7875c7 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -1304,7 +1304,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
struct cifsFileInfo *smb_file_src = src_file->private_data;
struct cifsFileInfo *smb_file_target = dst_file->private_data;
struct cifs_tcon *target_tcon, *src_tcon;
- unsigned long long i_size, old_size, new_size, zero_point;
+ unsigned long long i_size, new_size;
unsigned long long destend, fstart, fend;
unsigned int xid;
int rc;
@@ -1372,7 +1372,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
goto unlock;
spin_lock(&target_inode->i_lock);
- if (fend > zero_point)
+ if (fend > target_cifsi->netfs._zero_point)
netfs_write_zero_point(target_inode, fend + 1);
i_size = target_inode->i_size;
spin_unlock(&target_inode->i_lock);
@@ -1387,7 +1387,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
if (target_tcon->ses->server->ops->duplicate_extents) {
rc = target_tcon->ses->server->ops->duplicate_extents(xid,
smb_file_src, smb_file_target, off, len, destoff);
- if (rc == 0 && new_size > old_size) {
+ if (rc == 0 && new_size > i_size) {
truncate_setsize(target_inode, new_size);
fscache_resize_cookie(cifs_inode_cookie(target_inode),
new_size);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] cifs: Fix undefined variables
2026-05-18 21:13 [PATCH] cifs: Fix undefined variables David Howells
@ 2026-05-19 0:54 ` Linus Torvalds
0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2026-05-19 0:54 UTC (permalink / raw)
To: David Howells
Cc: Steve French, Nathan Chancellor, kernel test robot,
Paulo Alcantara, Matthew Wilcox, Christian Brauner, linux-cifs,
netfs, linux-fsdevel, linux-kernel
On Mon, 18 May 2026 at 14:13, David Howells <dhowells@redhat.com> wrote:
>
> Fix a couple of undefined variables introduced by the patch to fix tearing
> on ->remote_i_size and ->zero_point.
Applied directly.
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-19 0:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-18 21:13 [PATCH] cifs: Fix undefined variables David Howells
2026-05-19 0:54 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®