Skip to content

Commit 74566de

Browse files
committed
smb: client: fix zero rsize error messages
JIRA: https://issues.redhat.com/browse/RHEL-104401 Conflicts: - Code difference due to lack of netfslib support in RHEL 9.7. The equivalent cifs_prepare_read() function in RHEL 9.7 is cifs_send_async_read(), so place the changes there instead. commit 3965c23 Author: Paulo Alcantara <[email protected]> Date: Mon May 12 14:58:36 2025 -0300 smb: client: fix zero rsize error messages cifs_prepare_read() might be called with a disconnected channel, where TCP_Server_Info::max_read is set to zero due to reconnect, so calling ->negotiate_rize() will set @rsize to default min IO size (64KiB) and then logging CIFS: VFS: SMB: Zero rsize calculated, using minimum value 65536 If the reconnect happens in cifsd thread, cifs_renegotiate_iosize() will end up being called and then @rsize set to the expected value. Since we can't rely on the value of @server->max_read by the time we call cifs_prepare_read(), try to ->negotiate_rize() only if @cifs_sb->ctx->rsize is zero. Reported-by: Steve French <[email protected]> Fixes: c59f7c9 ("smb: client: ensure aligned IO sizes") Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Steve French <[email protected]> Signed-off-by: Paulo Alcantara <[email protected]>
1 parent 270010b commit 74566de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/smb/client/file.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4185,8 +4185,10 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file,
41854185
break;
41864186
}
41874187

4188-
cifs_negotiate_rsize(server, cifs_sb->ctx,
4189-
tlink_tcon(open_file->tlink));
4188+
if (cifs_sb->ctx->rsize == 0) {
4189+
cifs_negotiate_rsize(server, cifs_sb->ctx,
4190+
tlink_tcon(open_file->tlink));
4191+
}
41904192

41914193
rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize,
41924194
&rsize, credits);

0 commit comments

Comments
 (0)