diff options
author | Wang Zhaolong <wangzhaolong1@huawei.com> | 2025-03-31 16:33:14 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2025-04-01 05:12:31 +0300 |
commit | 287906b20035a04a234d1a3c64f760a5678387be (patch) | |
tree | 8e924fdefe6b0aad8cfde203138902d07d0b88a5 /tools/perf/scripts/python/mem-phys-addr.py | |
parent | a091d9711bdee46a76fa14fad31cb261a6dad74a (diff) | |
download | linux-287906b20035a04a234d1a3c64f760a5678387be.tar.xz |
smb: client: Store original IO parameters and prevent zero IO sizes
During mount option processing and negotiation with the server, the
original user-specified rsize/wsize values were being modified directly.
This makes it impossible to recover these values after a connection
reset, leading to potential degraded performance after reconnection.
The other problem is that When negotiating read and write sizes, there are
cases where the negotiated values might calculate to zero, especially
during reconnection when server->max_read or server->max_write might be
reset. In general, these values come from the negotiation response.
According to MS-SMB2 specification, these values should be at least 65536
bytes.
This patch improves IO parameter handling:
1. Adds vol_rsize and vol_wsize fields to store the original user-specified
values separately from the negotiated values
2. Uses got_rsize/got_wsize flags to determine if values were
user-specified rather than checking for non-zero values, which is more
reliable
3. Adds a prevent_zero_iosize() helper function to ensure IO sizes are
never negotiated down to zero, which could happen in edge cases like
when server->max_read/write is zero
The changes make the CIFS client more resilient to unusual server
responses and reconnection scenarios, preventing potential failures
when IO sizes are calculated to be zero.
Signed-off-by: Wang Zhaolong <wangzhaolong1@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions