smb: smbdirect/client/server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks
Subsystems (3)
Stefan Metzmacher
reviewerv3 cover smb: smbdirect/client/server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks
Hi,
here are some small cleanups for a problem Nanjae reported, where two WARN_ON_ONCE(sc->status != ...) checks where triggered by a Windows 11 client.
The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful WARN_ONCE() message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
Thanks!
metze
v3: move __SMBDIRECT_SOCKET_DISCONNECT() defines before including
smbdirect headers in order to avoid problems with the follow up changes for 6.19
v2: adjust for the case where the recv completion arrives before
RDMA_CM_EVENT_ESTABLISHED and improve commit messages
Stefan Metzmacher (4):
smb: smbdirect: introduce SMBDIRECT_DEBUG_ERR_PTR() helper
smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()
smb: server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in
recv_done() and smb_direct_cm_handler()
smb: client: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in
recv_done() and smbd_conn_upcall()
fs/smb/client/smbdirect.c | 28 ++++++------ fs/smb/common/smbdirect/smbdirect_socket.h | 51 ++++++++++++++++++++++ fs/smb/server/transport_rdma.c | 40 +++++++++++++---- 3 files changed, 98 insertions(+), 21 deletions(-)
Signature · 1 line
2.43.0
Stefan Metzmacher
reviewerPATCH v3 1/4 smb: smbdirect: introduce SMBDIRECT_DEBUG_ERR_PTR() helper
This can be used like this:
int err = somefunc();
pr_warn("err=%1pe\n", SMBDIRECT_DEBUG_ERR_PTR(err));This will be used in the following fixes in order
to be prepared to identify real world problems
more easily.
--- fs/smb/common/smbdirect/smbdirect_socket.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
fs/smb/common/smbdirect/smbdirect_socket.h +13 -0
@@ -74,6 +74,19 @@ const char *smbdirect_socket_status_string(enum smbdirect_socket_status status)return "<unknown>" ; } +/* +* This can be used with %1pe to print errors as strings or '0' +* And it avoids warnings like: warn: passing zero to 'ERR_PTR' +* from smatch -p=kernel --pedantic +*/ +static __always_inline +const void * __must_check SMBDIRECT_DEBUG_ERR_PTR(long error) +{ +if (error ==0 ) +return NULL ; +return ERR_PTR (error); +} +enum smbdirect_keepalive_status {SMBDIRECT_KEEPALIVE_NONE ,SMBDIRECT_KEEPALIVE_PENDING ,
Signature · 1 line
2.43.0
Stefan Metzmacher
reviewerPATCH v3 2/4 smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()
In reply to Stefan MetzmacherThese will be used in various places in order to assert the current status mostly during the connect and negotiation phase. It will replace the WARN_ON_ONCE(sc->status != ...) calls, which are very useless in order to identify the problem that happened.
As a start client and server will need to define their own __SMBDIRECT_SOCKET_DISCONNECT(__sc) macro in order to use SMBDIRECT_CHECK_STATUS_DISCONNECT().
--- fs/smb/common/smbdirect/smbdirect_socket.h | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+)
fs/smb/common/smbdirect/smbdirect_socket.h +38 -0
@@ -394,6 +394,44 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)init_waitqueue_head (&sc->mr_io.cleanup.wait_queue); } +#define __SMBDIRECT_CHECK_STATUS_FAILED (__sc, __expected_status, __error_cmd, __unexpected_cmd) ({ \ + bool __failed = false; \ + if (unlikely((__sc)->first_error)) { \ + __failed = true; \ + __error_cmd \ + } else if (unlikely((__sc)->status != (__expected_status))) { \ + __failed = true; \ + __unexpected_cmd \ + } \ + __failed; \ +}) + +#define __SMBDIRECT_CHECK_STATUS_WARN (__sc, __expected_status, __unexpected_cmd) \ + __SMBDIRECT_CHECK_STATUS_FAILED(__sc, __expected_status, \ + , \ + { \ + const struct sockaddr_storage *__src = NULL; \ + const struct sockaddr_storage *__dst = NULL; \ + if ((__sc)->rdma.cm_id) { \ + __src = &(__sc)->rdma.cm_id->route.addr.src_addr; \ + __dst = &(__sc)->rdma.cm_id->route.addr.dst_addr; \ + } \ + WARN_ONCE(1, \ + "expected[%s] != %s first_error=%1pe local=%pISpsfc remote=%pISpsfc\n", \ + smbdirect_socket_status_string(__expected_status), \ + smbdirect_socket_status_string((__sc)->status), \ + SMBDIRECT_DEBUG_ERR_PTR((__sc)->first_error), \ + __src, __dst); \ + __unexpected_cmd \ + }) + +#define SMBDIRECT_CHECK_STATUS_WARN(__sc, __expected_status) \ + __SMBDIRECT_CHECK_STATUS_WARN(__sc, __expected_status, /* nothing */) + +#define SMBDIRECT_CHECK_STATUS_DISCONNECT (__sc, __expected_status) \ + __SMBDIRECT_CHECK_STATUS_WARN(__sc, __expected_status, \ + __SMBDIRECT_SOCKET_DISCONNECT(__sc);) +struct smbdirect_send_io {struct smbdirect_socket *socket;struct ib_cqe cqe;
Signature · 1 line
2.43.0
Stefan Metzmacher
reviewerPATCH v3 3/4 smb: server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smb_direct_cm_handler()
In reply to Stefan MetzmacherNamjae reported the following:
I have a simple file copy test with windows 11 client, and get the following error message.
[ 894.140312] ------------[ cut here ]------------ [ 894.140316] WARNING: CPU: 1 PID: 116 at fs/smb/server/transport_rdma.c:642 recv_done+0x308/0x360 [ksmbd] [ 894.140335] Modules linked in: ksmbd cmac nls_utf8 nls_ucs2_utils
libarc4 nls_iso8859_1 snd_hda_codec_intelhdmi snd_hda_codec_hdmi snd_hda_codec_alc882 snd_hda_codec_realtek_lib snd_hda_codec_generic rpcrdma intel_rapl_msr rdma_ucm intel_rapl_common snd_hda_intel ib_iser snd_hda_codec intel_uncore_frequency intel_uncore_frequency_common snd_hda_core intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp snd_intel_dspcfg libiscsi snd_intel_sdw_acpi coretemp scsi_transport_iscsi snd_hwdep kvm_intel i915 snd_pcm ib_umad rdma_cm snd_seq_midi ib_ipoib kvm snd_seq_midi_event iw_cm snd_rawmidi ghash_clmulni_intel ib_cm aesni_intel snd_seq mei_hdcp drm_buddy rapl snd_seq_device eeepc_wmi asus_wmi snd_timer intel_cstate ttm snd drm_client_lib drm_display_helper sparse_keymap soundcore platform_profile mxm_wmi wmi_bmof joydev mei_me cec acpi_pad mei rc_core drm_kms_helper input_leds i2c_algo_bit mac_hid sch_fq_codel msr parport_pc ppdev lp nfsd parport auth_rpcgss binfmt_misc nfs_acl lockd grace drm sunrpc ramoops efi_pstore
[ 894.140414] reed_solomon pstore_blk pstore_zone autofs4 btrfs
blake2b_generic xor raid6_pq mlx5_ib ib_uverbs ib_core hid_generic uas
usbhid hid r8169 i2c_i801 usb_storage i2c_mux i2c_smbus mlx5_core
realtek ahci mlxfw psample libahci video wmi [last unloaded: ksmbd]
[ 894.140442] CPU: 1 UID: 0 PID: 116 Comm: kworker/1:1H Tainted: G
W 6.18.0-rc5+ #1 PREEMPT(voluntary)
[ 894.140447] Tainted: [W]=WARN
[ 894.140448] Hardware name: System manufacturer System Product
Name/H110M-K, BIOS 3601 12/12/2017
[ 894.140450] Workqueue: ib-comp-wq ib_cq_poll_work [ib_core]
[ 894.140476] RIP: 0010:recv_done+0x308/0x360 [ksmbd]
[ 894.140487] Code: 2e f2 ff ff 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc
cc cc cc 41 8b 55 10 49 8b 75 08 b9 02 00 00 00 e8 ed f4 f2 c3 e9 59
fd ff ff <0f> 0b e9 02 ff ff ff 49 8b 74 24 28 49 8d 94 24 c8 00 00 00
bf 00
[ 894.140490] RSP: 0018:ffffa47ec03f3d78 EFLAGS: 00010293
[ 894.140492] RAX: 0000000000000001 RBX: ffff8eb84c818000 RCX: 000000010002ba00
[ 894.140494] RDX: 0000000037600001 RSI: 0000000000000083 RDI: ffff8eb92ec9ee40
[ 894.140496] RBP: ffffa47ec03f3da0 R08: 0000000000000000 R09: 0000000000000010
[ 894.140498] R10: ffff8eb801705680 R11: fefefefefefefeff R12: ffff8eb7454b8810
[ 894.140499] R13: ffff8eb746deb988 R14: ffff8eb746deb980 R15: ffff8eb84c818000
[ 894.140501] FS: 0000000000000000(0000) GS:ffff8eb9a7355000(0000)
knlGS:0000000000000000
[ 894.140503] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 894.140505] CR2: 00002d9401d60018 CR3: 0000000010a40006 CR4: 00000000003726f0
[ 894.140507] Call Trace:
[ 894.140509] <TASK>
[ 894.140512] __ib_process_cq+0x8e/0x190 [ib_core]
[ 894.140530] ib_cq_poll_work+0x2f/0x90 [ib_core]
[ 894.140545] process_scheduled_works+0xd4/0x430
[ 894.140554] worker_thread+0x12a/0x270
[ 894.140558] kthread+0x10d/0x250
[ 894.140564] ? __pfx_worker_thread+0x10/0x10
[ 894.140567] ? __pfx_kthread+0x10/0x10
[ 894.140571] ret_from_fork+0x11a/0x160
[ 894.140574] ? __pfx_kthread+0x10/0x10
[ 894.140577] ret_from_fork_asm+0x1a/0x30
[ 894.140584] </TASK>
[ 894.140585] ---[ end trace 0000000000000000 ]---
[ 894.154363] ------------[ cut here ]------------
[ 894.154367] WARNING: CPU: 3 PID: 5543 at
fs/smb/server/transport_rdma.c:1728 smb_direct_cm_handler+0x121/0x130
[ksmbd]
[ 894.154384] Modules linked in: ksmbd cmac nls_utf8 nls_ucs2_utilslibarc4 nls_iso8859_1 snd_hda_codec_intelhdmi snd_hda_codec_hdmi snd_hda_codec_alc882 snd_hda_codec_realtek_lib snd_hda_codec_generic rpcrdma intel_rapl_msr rdma_ucm intel_rapl_common snd_hda_intel ib_iser snd_hda_codec intel_uncore_frequency intel_uncore_frequency_common snd_hda_core intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp snd_intel_dspcfg libiscsi snd_intel_sdw_acpi coretemp scsi_transport_iscsi snd_hwdep kvm_intel i915 snd_pcm ib_umad rdma_cm snd_seq_midi ib_ipoib kvm snd_seq_midi_event iw_cm snd_rawmidi ghash_clmulni_intel ib_cm aesni_intel snd_seq mei_hdcp drm_buddy rapl snd_seq_device eeepc_wmi asus_wmi snd_timer intel_cstate ttm snd drm_client_lib drm_display_helper sparse_keymap soundcore platform_profile mxm_wmi wmi_bmof joydev mei_me cec acpi_pad mei rc_core drm_kms_helper input_leds i2c_algo_bit mac_hid sch_fq_codel msr parport_pc ppdev lp nfsd parport auth_rpcgss binfmt_misc nfs_acl lockd grace drm sunrpc ramoops efi_pstore
[ 894.154456] reed_solomon pstore_blk pstore_zone autofs4 btrfs
blake2b_generic xor raid6_pq mlx5_ib ib_uverbs ib_core hid_generic uas
usbhid hid r8169 i2c_i801 usb_storage i2c_mux i2c_smbus mlx5_core
realtek ahci mlxfw psample libahci video wmi [last unloaded: ksmbd]
[ 894.154483] CPU: 3 UID: 0 PID: 5543 Comm: kworker/3:6 Tainted: G
W 6.18.0-rc5+ #1 PREEMPT(voluntary)
[ 894.154487] Tainted: [W]=WARN
[ 894.154488] Hardware name: System manufacturer System Product
Name/H110M-K, BIOS 3601 12/12/2017
[ 894.154490] Workqueue: ib_cm cm_work_handler [ib_cm]
[ 894.154499] RIP: 0010:smb_direct_cm_handler+0x121/0x130 [ksmbd]
[ 894.154507] Code: e7 e8 13 b1 ef ff 44 89 e1 4c 89 ee 48 c7 c7 80
d7 59 c1 48 89 c2 e8 2e 4d ef c3 31 c0 5b 41 5c 41 5d 41 5e 5d c3 cc
cc cc cc <0f> 0b eb a5 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90
90 90
[ 894.154510] RSP: 0018:ffffa47ec1b27c00 EFLAGS: 00010206
[ 894.154512] RAX: ffffffffc1304e00 RBX: ffff8eb89ae50880 RCX: 0000000000000000
[ 894.154514] RDX: ffff8eb730960000 RSI: ffffa47ec1b27c60 RDI: ffff8eb7454b9400
[ 894.154515] RBP: ffffa47ec1b27c20 R08: 0000000000000002 R09: ffff8eb730b8c18b
[ 894.154517] R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000009
[ 894.154518] R13: ffff8eb7454b9400 R14: ffff8eb7454b8810 R15: ffff8eb815c43000
[ 894.154520] FS: 0000000000000000(0000) GS:ffff8eb9a7455000(0000)
knlGS:0000000000000000
[ 894.154522] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 894.154523] CR2: 00007fe1310e99d0 CR3: 0000000010a40005 CR4: 00000000003726f0
[ 894.154525] Call Trace:
[ 894.154527] <TASK>
[ 894.154530] cma_cm_event_handler+0x27/0xd0 [rdma_cm]
[ 894.154541] cma_ib_handler+0x99/0x2e0 [rdma_cm]
[ 894.154551] cm_process_work+0x28/0xf0 [ib_cm]
[ 894.154557] cm_queue_work_unlock+0x41/0xf0 [ib_cm]
[ 894.154563] cm_work_handler+0x2eb/0x25b0 [ib_cm]
[ 894.154568] ? pwq_activate_first_inactive+0x52/0x70
[ 894.154572] ? pwq_dec_nr_in_flight+0x244/0x330
[ 894.154575] process_scheduled_works+0xd4/0x430
[ 894.154579] worker_thread+0x12a/0x270
[ 894.154581] kthread+0x10d/0x250
[ 894.154585] ? __pfx_worker_thread+0x10/0x10
[ 894.154587] ? __pfx_kthread+0x10/0x10
[ 894.154590] ret_from_fork+0x11a/0x160
[ 894.154593] ? __pfx_kthread+0x10/0x10
[ 894.154596] ret_from_fork_asm+0x1a/0x30
[ 894.154602] </TASK>
[ 894.154603] ---[ end trace 0000000000000000 ]---
[ 894.154931] ksmbd: smb_direct: disconnected
[ 894.157278] ksmbd: smb_direct: disconnectedI guess sc->first_error is already set and sc->status is thus unexpected, so this should avoid the WARN[_ON]_ONCE() if sc->first_error is already set and have a usable error path.
While there set sc->first_error as soon as possible.
v1 of this patch revealed the real problem with this message:
[ 309.560973] expected[NEGOTIATE_NEEDED] != RDMA_CONNECT_RUNNING first_error=0 local=192.168.0.200:445 remote=192.168.0.100:60445 [ 309.561034] WARNING: CPU: 2 PID: 78 at transport_rdma.c:643
recv_done+0x2fa/0x3d0 [ksmbd]
Some drivers (at least mlx5_ib) might post a recv completion before RDMA_CM_EVENT_ESTABLISHED, so we need to adjust our expectation in that case.
--- fs/smb/server/transport_rdma.c | 40 +++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-)
fs/smb/server/transport_rdma.c +32 -8
@@ -19,6 +19,8 @@#include <rdma/rdma_cm.h> #include <rdma/rw.h> +#define __SMBDIRECT_SOCKET_DISCONNECT (__sc) smb_direct_disconnect_rdma_connection(__sc) +#include "glob.h" #include "connection.h" #include "smb_common.h"
@@ -231,6 +233,9 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)struct smbdirect_socket *sc = container_of(work, struct smbdirect_socket, disconnect_work); +if (sc->first_error ==0 ) + sc->first_error = -ECONNABORTED ; +/* * make sure this and other work is not queued again * but here we don't block and avoid
@@ -241,9 +246,6 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)disable_delayed_work (&sc->idle.timer_work);disable_work (&sc->idle.immediate_work); -if (sc->first_error ==0 ) - sc->first_error = -ECONNABORTED ; -switch (sc->status) {case SMBDIRECT_SOCKET_NEGOTIATE_NEEDED :case SMBDIRECT_SOCKET_NEGOTIATE_RUNNING :
@@ -287,6 +289,9 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)static void smb_direct_disconnect_rdma_connection (struct smbdirect_socket *sc) { +if (sc->first_error ==0 ) + sc->first_error = -ECONNABORTED ; +/* * make sure other work (than disconnect_work) is * not queued again but here we don't block and avoid
@@ -296,9 +301,6 @@ smb_direct_disconnect_rdma_connection(struct smbdirect_socket *sc)disable_work (&sc->idle.immediate_work);disable_delayed_work (&sc->idle.timer_work); -if (sc->first_error ==0 ) - sc->first_error = -ECONNABORTED ; -switch (sc->status) {case SMBDIRECT_SOCKET_RESOLVE_ADDR_FAILED :case SMBDIRECT_SOCKET_RESOLVE_ROUTE_FAILED :
@@ -639,7 +641,18 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)return ; } sc->recv_io.reassembly.full_packet_received = true; -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_NEGOTIATE_NEEDED ); +/* +* Some drivers (at least mlx5_ib) might post a +* recv completion before RDMA_CM_EVENT_ESTABLISHED, +* we need to adjust our expectation in that case. +*/ +if (!sc->first_error && sc->status ==SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING ) + sc->status =SMBDIRECT_SOCKET_NEGOTIATE_NEEDED ; +if (SMBDIRECT_CHECK_STATUS_WARN (sc,SMBDIRECT_SOCKET_NEGOTIATE_NEEDED )) { +put_recvmsg (sc, recvmsg); +smb_direct_disconnect_rdma_connection (sc); +return ; + } sc->status =SMBDIRECT_SOCKET_NEGOTIATE_RUNNING ;enqueue_reassembly (sc, recvmsg,0 );wake_up (&sc->status_wait);
@@ -1725,7 +1738,18 @@ static int smb_direct_cm_handler(struct rdma_cm_id *cm_id,switch (event->event) {case RDMA_CM_EVENT_ESTABLISHED : { -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING ); +/* +* Some drivers (at least mlx5_ib) might post a +* recv completion before RDMA_CM_EVENT_ESTABLISHED, +* we need to adjust our expectation in that case. +* +* As we already started the negotiation, we just +* ignore RDMA_CM_EVENT_ESTABLISHED here. +*/ +if (!sc->first_error && sc->status >SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING ) +break ; +if (SMBDIRECT_CHECK_STATUS_DISCONNECT (sc,SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING )) +break ; sc->status =SMBDIRECT_SOCKET_NEGOTIATE_NEEDED ;wake_up (&sc->status_wait);break ;
Signature · 1 line
2.43.0
Stefan Metzmacher
reviewerPATCH v3 4/4 smb: client: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smbd_conn_upcall()
In reply to Stefan Metzmachersc->first_error might already be set and sc->status is thus unexpected, so this should avoid the WARN[_ON]_ONCE() if sc->first_error is already set and have a usable error path.
While there set sc->first_error as soon as possible.
This is done based on a problem seen in similar places on the server. And there it was already very useful in order to find the problem when we have a meaningful WARN_ONCE() that prints details about the connection.
This is much more useful:
[ 309.560973] expected[NEGOTIATE_NEEDED] != RDMA_CONNECT_RUNNING first_error=0 local=192.168.0.200:445 remote=192.168.0.100:60445 [ 309.561034] WARNING: CPU: 2 PID: 78 at transport_rdma.c:643
recv_done+0x2fa/0x3d0 [ksmbd]
than what we had before (only):
[ 894.140316] WARNING: CPU: 1 PID: 116 at
fs/smb/server/transport_rdma.c:642 recv_done+0x308/0x360 [ksmbd]
--- fs/smb/client/smbdirect.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
fs/smb/client/smbdirect.c +15 -13
@@ -7,6 +7,7 @@#include <linux/module.h> #include <linux/highmem.h> #include <linux/folio_queue.h> +#define __SMBDIRECT_SOCKET_DISCONNECT (__sc) smbd_disconnect_rdma_connection(__sc)#include "../common/smbdirect/smbdirect_pdu.h" #include "smbdirect.h" #include "cifs_debug.h"
@@ -186,6 +187,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)struct smbdirect_socket *sc = container_of(work, struct smbdirect_socket, disconnect_work); +if (sc->first_error ==0 ) + sc->first_error = -ECONNABORTED ; +/* * make sure this and other work is not queued again * but here we don't block and avoid
@@ -197,9 +201,6 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)disable_work (&sc->idle.immediate_work);disable_delayed_work (&sc->idle.timer_work); -if (sc->first_error ==0 ) - sc->first_error = -ECONNABORTED ; -switch (sc->status) {case SMBDIRECT_SOCKET_NEGOTIATE_NEEDED :case SMBDIRECT_SOCKET_NEGOTIATE_RUNNING :
@@ -242,6 +243,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)static void smbd_disconnect_rdma_connection (struct smbdirect_socket *sc) { +if (sc->first_error ==0 ) + sc->first_error = -ECONNABORTED ; +/* * make sure other work (than disconnect_work) is * not queued again but here we don't block and avoid
@@ -252,9 +256,6 @@ static void smbd_disconnect_rdma_connection(struct smbdirect_socket *sc)disable_work (&sc->idle.immediate_work);disable_delayed_work (&sc->idle.timer_work); -if (sc->first_error ==0 ) - sc->first_error = -ECONNABORTED ; -switch (sc->status) {case SMBDIRECT_SOCKET_RESOLVE_ADDR_FAILED :case SMBDIRECT_SOCKET_RESOLVE_ROUTE_FAILED :
@@ -322,27 +323,27 @@ static int smbd_conn_upcall(switch (event->event) {case RDMA_CM_EVENT_ADDR_RESOLVED : -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RESOLVE_ADDR_RUNNING ); +if (SMBDIRECT_CHECK_STATUS_DISCONNECT (sc,SMBDIRECT_SOCKET_RESOLVE_ADDR_RUNNING )) +break ; sc->status =SMBDIRECT_SOCKET_RESOLVE_ROUTE_NEEDED ;wake_up (&sc->status_wait);break ;case RDMA_CM_EVENT_ROUTE_RESOLVED : -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RESOLVE_ROUTE_RUNNING ); +if (SMBDIRECT_CHECK_STATUS_DISCONNECT (sc,SMBDIRECT_SOCKET_RESOLVE_ROUTE_RUNNING )) +break ; sc->status =SMBDIRECT_SOCKET_RDMA_CONNECT_NEEDED ;wake_up (&sc->status_wait);break ;case RDMA_CM_EVENT_ADDR_ERROR :log_rdma_event (ERR ,"connecting failed event=%s\n" , event_name); -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RESOLVE_ADDR_RUNNING ); sc->status =SMBDIRECT_SOCKET_RESOLVE_ADDR_FAILED ;smbd_disconnect_rdma_work (&sc->disconnect_work);break ;case RDMA_CM_EVENT_ROUTE_ERROR :log_rdma_event (ERR ,"connecting failed event=%s\n" , event_name); -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RESOLVE_ROUTE_RUNNING ); sc->status =SMBDIRECT_SOCKET_RESOLVE_ROUTE_FAILED ;smbd_disconnect_rdma_work (&sc->disconnect_work);break ;
@@ -428,7 +429,8 @@ static int smbd_conn_upcall(min_t (u8, sp->responder_resources, peer_responder_resources); -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING ); +if (SMBDIRECT_CHECK_STATUS_DISCONNECT (sc,SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING )) +break ; sc->status =SMBDIRECT_SOCKET_NEGOTIATE_NEEDED ;wake_up (&sc->status_wait);break ;
@@ -437,7 +439,6 @@ static int smbd_conn_upcall(case RDMA_CM_EVENT_UNREACHABLE :case RDMA_CM_EVENT_REJECTED :log_rdma_event (ERR ,"connecting failed event=%s\n" , event_name); -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING ); sc->status =SMBDIRECT_SOCKET_RDMA_CONNECT_FAILED ;smbd_disconnect_rdma_work (&sc->disconnect_work);break ;
@@ -699,7 +700,8 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc) negotiate_done =process_negotiation_response (response, wc->byte_len);put_receive_buffer (sc, response); -WARN_ON_ONCE (sc->status !=SMBDIRECT_SOCKET_NEGOTIATE_RUNNING ); +if (SMBDIRECT_CHECK_STATUS_WARN (sc,SMBDIRECT_SOCKET_NEGOTIATE_RUNNING )) + negotiate_done = false;if (!negotiate_done) { sc->status =SMBDIRECT_SOCKET_NEGOTIATE_FAILED ;smbd_disconnect_rdma_connection (sc);
Signature · 1 line
2.43.0
Namjae Jeon
maintainerQuoted 11 lines · Stefan Metzmacher
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Quoted 5 lines
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
[ 424.088714] ksmbd: smb_direct: disconnected [ 424.088729] ksmbd: sock_read failed: -107 [ 424.088881] ksmbd: Failed to send message: -107 [ 424.088908] ksmbd: Failed to send message: -107 [ 424.088922] ksmbd: Failed to send message: -107 [ 424.088980] ksmbd: Failed to send message: -107 [ 424.089044] ksmbd: Failed to send message: -107 [ 424.089058] ksmbd: Failed to send message: -107 [ 424.089062] ksmbd: Failed to send message: -107 [ 424.089068] ksmbd: Failed to send message: -107 [ 424.089078] ksmbd: Failed to send message: -107 [ 424.089085] ksmbd: Failed to send message: -107 [ 424.089104] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0 [ 424.089111] ksmbd: Failed to send message: -107 [ 424.089140] ksmbd: Failed to send message: -107 [ 424.089160] ksmbd: Failed to send message: -107 [ 424.090146] ksmbd: Failed to send message: -107 [ 424.090160] ksmbd: Failed to send message: -107 [ 424.090180] ksmbd: Failed to send message: -107 [ 424.090188] ksmbd: Failed to send message: -107 [ 424.090200] ksmbd: Failed to send message: -107 [ 424.090228] ksmbd: Failed to send message: -107 [ 424.090245] ksmbd: Failed to send message: -107 [ 424.090261] ksmbd: Failed to send message: -107 [ 424.090274] ksmbd: Failed to send message: -107 [ 424.090317] ksmbd: Failed to send message: -107 [ 424.090323] ksmbd: Failed to send message: -107 [ 432.648368] ksmbd: smb_direct: disconnected [ 432.648383] ksmbd: sock_read failed: -107 [ 432.648800] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0 [ 432.649835] ksmbd: Failed to send message: -107 [ 432.649870] ksmbd: Failed to send message: -107 [ 432.649883] ksmbd: Failed to send message: -107 [ 432.649894] ksmbd: Failed to send message: -107 [ 432.649913] ksmbd: Failed to send message: -107 [ 432.649966] ksmbd: Failed to send message: -107 [ 432.650023] ksmbd: Failed to send message: -107 [ 432.650077] ksmbd: Failed to send message: -107 [ 432.650138] ksmbd: Failed to send message: -107 [ 432.650151] ksmbd: Failed to send message: -107 [ 432.650173] ksmbd: Failed to send message: -107 [ 432.650182] ksmbd: Failed to send message: -107 [ 432.650196] ksmbd: Failed to send message: -107 [ 432.650205] ksmbd: Failed to send message: -107 [ 432.650219] ksmbd: Failed to send message: -107 [ 432.650229] ksmbd: Failed to send message: -107 [ 432.650238] ksmbd: Failed to send message: -107 [ 432.650256] ksmbd: Failed to send message: -107 [ 432.650270] ksmbd: Failed to send message: -107 [ 450.254342] ksmbd: Failed to send message: -107 [ 450.254644] ksmbd: Failed to send message: -107 [ 450.254672] ksmbd: Failed to send message: -107 [ 450.254688] ksmbd: Failed to send message: -107 [ 450.254825] ksmbd: Failed to send message: -107 [ 450.254859] ksmbd: smb_direct: disconnected [ 450.254866] ksmbd: sock_read failed: -107 [ 450.255282] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0 [ 450.255342] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0
Quoted 27 lines
Thanks!
metzev3: move
__SMBDIRECT_SOCKET_DISCONNECT()defines before including
smbdirect headers in order to avoid problems with the follow up changes for 6.19v2: adjust for the case where the recv completion arrives before
RDMA_CM_EVENT_ESTABLISHEDand improve commit messagesStefan Metzmacher (4):
smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper
smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()
smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks in
recv_done()andsmb_direct_cm_handler()
smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks in
recv_done()andsmbd_conn_upcall()fs/smb/client/smbdirect.c | 28 ++++++------ fs/smb/common/smbdirect/smbdirect_socket.h | 51 ++++++++++++++++++++++ fs/smb/server/transport_rdma.c | 40 +++++++++++++---- 3 files changed, 98 insertions(+), 21 deletions(-)--
2.43.0
Namjae Jeon
maintainerQuoted 13 lines · Namjae Jeon
Quoted 11 lines · Stefan Metzmacher
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Quoted 5 lines
Quoted 5 lines
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Quoted 91 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
[ 424.088714] ksmbd: smb_direct: disconnected [ 424.088729] ksmbd: sock_read failed: -107 [ 424.088881] ksmbd: Failed to send message: -107 [ 424.088908] ksmbd: Failed to send message: -107 [ 424.088922] ksmbd: Failed to send message: -107 [ 424.088980] ksmbd: Failed to send message: -107 [ 424.089044] ksmbd: Failed to send message: -107 [ 424.089058] ksmbd: Failed to send message: -107 [ 424.089062] ksmbd: Failed to send message: -107 [ 424.089068] ksmbd: Failed to send message: -107 [ 424.089078] ksmbd: Failed to send message: -107 [ 424.089085] ksmbd: Failed to send message: -107 [ 424.089104] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0 [ 424.089111] ksmbd: Failed to send message: -107 [ 424.089140] ksmbd: Failed to send message: -107 [ 424.089160] ksmbd: Failed to send message: -107 [ 424.090146] ksmbd: Failed to send message: -107 [ 424.090160] ksmbd: Failed to send message: -107 [ 424.090180] ksmbd: Failed to send message: -107 [ 424.090188] ksmbd: Failed to send message: -107 [ 424.090200] ksmbd: Failed to send message: -107 [ 424.090228] ksmbd: Failed to send message: -107 [ 424.090245] ksmbd: Failed to send message: -107 [ 424.090261] ksmbd: Failed to send message: -107 [ 424.090274] ksmbd: Failed to send message: -107 [ 424.090317] ksmbd: Failed to send message: -107 [ 424.090323] ksmbd: Failed to send message: -107 [ 432.648368] ksmbd: smb_direct: disconnected [ 432.648383] ksmbd: sock_read failed: -107 [ 432.648800] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0 [ 432.649835] ksmbd: Failed to send message: -107 [ 432.649870] ksmbd: Failed to send message: -107 [ 432.649883] ksmbd: Failed to send message: -107 [ 432.649894] ksmbd: Failed to send message: -107 [ 432.649913] ksmbd: Failed to send message: -107 [ 432.649966] ksmbd: Failed to send message: -107 [ 432.650023] ksmbd: Failed to send message: -107 [ 432.650077] ksmbd: Failed to send message: -107 [ 432.650138] ksmbd: Failed to send message: -107 [ 432.650151] ksmbd: Failed to send message: -107 [ 432.650173] ksmbd: Failed to send message: -107 [ 432.650182] ksmbd: Failed to send message: -107 [ 432.650196] ksmbd: Failed to send message: -107 [ 432.650205] ksmbd: Failed to send message: -107 [ 432.650219] ksmbd: Failed to send message: -107 [ 432.650229] ksmbd: Failed to send message: -107 [ 432.650238] ksmbd: Failed to send message: -107 [ 432.650256] ksmbd: Failed to send message: -107 [ 432.650270] ksmbd: Failed to send message: -107 [ 450.254342] ksmbd: Failed to send message: -107 [ 450.254644] ksmbd: Failed to send message: -107 [ 450.254672] ksmbd: Failed to send message: -107 [ 450.254688] ksmbd: Failed to send message: -107 [ 450.254825] ksmbd: Failed to send message: -107 [ 450.254859] ksmbd: smb_direct: disconnected [ 450.254866] ksmbd: sock_read failed: -107 [ 450.255282] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0 [ 450.255342] ksmbd: smb_direct: Send error. status='WR flushed (5)', opcode=0Quoted 27 lines
Thanks!
metzev3: move
__SMBDIRECT_SOCKET_DISCONNECT()defines before including
smbdirect headers in order to avoid problems with the follow up changes for 6.19v2: adjust for the case where the recv completion arrives before
RDMA_CM_EVENT_ESTABLISHEDand improve commit messagesStefan Metzmacher (4):
smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper
smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()
smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks in
recv_done()andsmb_direct_cm_handler()
smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks in
recv_done()andsmbd_conn_upcall()fs/smb/client/smbdirect.c | 28 ++++++------ fs/smb/common/smbdirect/smbdirect_socket.h | 51 ++++++++++++++++++++++ fs/smb/server/transport_rdma.c | 40 +++++++++++++---- 3 files changed, 98 insertions(+), 21 deletions(-)--
2.43.0
Stefan Metzmacher
reviewerAm 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 11 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Quoted 5 lines
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
metze
Namjae Jeon
maintainerQuoted 19 lines · Stefan Metzmacher
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
Quoted 6 lines
Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
Quoted 2 lines
metze
Stefan Metzmacher
reviewerAm 26.11.25 um 16:17 schrieb Namjae Jeon:
Quoted 20 lines · Stefan Metzmacher
Quoted 19 lines
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
6.17 or just transport_rdma.* from 6.17, but the rest from 6.18?
Stefan Metzmacher
reviewerAm 26.11.25 um 16:18 schrieb Stefan Metzmacher via samba-technical:
Quoted 26 lines
Am 26.11.25 um 16:17 schrieb Namjae Jeon:
Quoted 25 lines · Stefan Metzmacher
Quoted 24 lines
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 21 lines · Stefan Metzmacher
Quoted 11 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Quoted 5 lines
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
With transport_rdma.* from restored from 6.17?
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
6.17 or just transport_rdma.* from 6.17, but the rest from 6.18?
Can you also test with 6.17 + fad988a2158d743da7971884b93482a73735b25e Maybe that changed things in order to let RDMA READs fail or cause a disconnect.
Otherwise I'd suggest to test the following commits in order to find where the problem was introduced:177368b9924314bde7d2ea6dc93de0d9ba728b61
After this it gets more tricky.
metze
Namjae Jeon
maintainerQuoted 29 lines · Stefan Metzmacher
Am 26.11.25 um 16:18 schrieb Stefan Metzmacher via samba-technical:
Quoted 27 lines
Am 26.11.25 um 16:17 schrieb Namjae Jeon:
Quoted 26 lines · Stefan Metzmacher
Quoted 25 lines
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 11 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Quoted 5 lines
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
6.17 or just transport_rdma.* from 6.17, but the rest from 6.18?
Can you also test with 6.17 +
fad988a2158d743da7971884b93482a73735b25eMaybe that changed things in order to let RDMA READs fail or cause a disconnect.
The kernel version I tested was 6.17.9 and this patch was already applied.
Quoted 4 lines
Otherwise I'd suggest to test the following commits in order to find where the problem was introduced:
177368b9924314bde7d2ea6dc93de0d9ba728b61
I don't have time to do this right now due to other work. Did you test it with a Windows client and can't find this issue?
Quoted 7 lines
After this it gets more tricky.
metze
Stefan Metzmacher
reviewerAm 27.11.25 um 00:10 schrieb Namjae Jeon:
Quoted 32 lines · Stefan Metzmacher
Quoted 31 lines
Am 26.11.25 um 16:18 schrieb Stefan Metzmacher via samba-technical:
Quoted 29 lines
Am 26.11.25 um 16:17 schrieb Namjae Jeon:
Quoted 27 lines · Stefan Metzmacher
Quoted 19 lines
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 6 lines
Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
6.17 or just transport_rdma.* from 6.17, but the rest from 6.18?
Can you also test with 6.17 +
fad988a2158d743da7971884b93482a73735b25eMaybe that changed things in order to let RDMA READs fail or cause a disconnect.The kernel version I tested was 6.17.9 and this patch was already applied.
Ah, good it also has:
smb: server: let smb_direct_flush_send_list() invalidate a remote key first
Quoted 5 lines
Quoted 3 lines
Otherwise I'd suggest to test the following commits in order to find where the problem was introduced:
177368b9924314bde7d2ea6dc93de0d9ba728b61I don't have time to do this right now due to other work. Did you test it with a Windows client and can't find this issue?
I can only reproduce the problem this patchset is fixing, (recv completion before getting the ESTABLISHED callback).
I tested with an Intel-E810-CQDA2 card in RoCEv2 mode and a Windows 2025 server (acting as client against ksmbd).
And I can only reproduce the problem with the recv completion
before the ESTABLISHED event. So this patchset is not only
used for setups with a connectx-7, btw were you testing with infiniband or rocev2?
Otherwise copying a 2G and 5G file to and from the share works without problems.
I used this to verify that rdma offload was used:
root@rdmatest04l0:~# cat ksmbd-rdma-xmit.bt
kprobe:smb_direct_rdma_xmit {
printf("%s pid=%d %s\n", comm, pid, func)
}
root@rdmatest04l0:~# bpftrace ksmbd-rdma-xmit.btAnd it printed a lot of kworker/4:1 pid=6162 smb_direct_rdma_xmit lines...
From the logs you send it seems the client terminated the tcp and rdma connections, do you see something in the clients event log?
metze
Stefan Metzmacher
reviewerAm 27.11.25 um 16:45 schrieb Stefan Metzmacher via samba-technical:
Quoted 56 lines
Am 27.11.25 um 00:10 schrieb Namjae Jeon:
Quoted 32 lines · Stefan Metzmacher
Quoted 31 lines
Am 26.11.25 um 16:18 schrieb Stefan Metzmacher via samba-technical:
Quoted 29 lines
Am 26.11.25 um 16:17 schrieb Namjae Jeon:
Quoted 27 lines · Stefan Metzmacher
Quoted 19 lines
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 6 lines
Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
6.17 or just transport_rdma.* from 6.17, but the rest from 6.18?
Can you also test with 6.17 +
fad988a2158d743da7971884b93482a73735b25eMaybe that changed things in order to let RDMA READs fail or cause a disconnect.The kernel version I tested was 6.17.9 and this patch was already applied.
Ah, good it also has:
smb: server: letsmb_direct_flush_send_list()invalidate a remote key firstQuoted 5 lines
Quoted 3 lines
Otherwise I'd suggest to test the following commits in order to find where the problem was introduced:
177368b9924314bde7d2ea6dc93de0d9ba728b61I don't have time to do this right now due to other work. Did you test it with a Windows client and can't find this issue?
I can only reproduce the problem this patchset is fixing, (recv completion before getting the ESTABLISHED callback).
I tested with an Intel-E810-CQDA2 card in RoCEv2 mode and a Windows 2025 server (acting as client against ksmbd).
Quoted 6 lines
And I can only reproduce the problem with the recv completion
before the ESTABLISHED event. So this patchset is not only
used for setups with a connectx-7, btw were you testing with infiniband or rocev2?Otherwise copying a 2G and 5G file to and from the share works without problems.
I also tested with my latest smbdirect.ko patchset
in the for-6.19/fs-smb-20251125-v4 branch, also without problems.
Stefan Metzmacher
reviewerAm 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 14 lines · Namjae Jeon
Quoted 13 lines · Stefan Metzmacher
Quoted 11 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Thanks!
metze
Namjae Jeon
maintainerQuoted 21 lines · Stefan Metzmacher
Am 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 19 lines · Namjae Jeon
Quoted 18 lines · Stefan Metzmacher
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.
Quoted 4 lines
Quoted 2 lines
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Steve, There are more patches in ksmbd-for-next-next.
Please apply the following 6 patches in #ksmbd-for-next-next to #ksmbd-for-next.
3858665313f1 (HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
ksmbd: ipc: fix use-after-free in ipc_msg_send_request b9c7d4fe6e93 smb: client: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smbd_conn_upcall()6c5ceb636d08 smb: server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smb_direct_cm_handler() d02a328304e5 smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()340255e842d5 smb: smbdirect: introduce SMBDIRECT_DEBUG_ERR_PTR() helper 01cba263d1bd ksmbd: vfs: fix race on m_flags in vfs_cache
Thanks.
Quoted 4 lines
Thanks!
metze
Namjae Jeon
maintainerQuoted 62 lines · Stefan Metzmacher
Am 27.11.25 um 16:45 schrieb Stefan Metzmacher via samba-technical:
Quoted 60 lines
Am 27.11.25 um 00:10 schrieb Namjae Jeon:
Quoted 32 lines · Stefan Metzmacher
Quoted 31 lines
Am 26.11.25 um 16:18 schrieb Stefan Metzmacher via samba-technical:
Quoted 29 lines
Am 26.11.25 um 16:17 schrieb Namjae Jeon:
Quoted 27 lines · Stefan Metzmacher
Quoted 19 lines
Am 26.11.25 um 00:50 schrieb Namjae Jeon:
Quoted 17 lines · Stefan Metzmacher
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 6 lines
Quoted 4 lines
First, the warning message has been improved. Thanks. However, when copying a 6-7GB file on a Windows client, the following error occurs. These error messages did not occur when testing with the older ksmbd rdma(https://github.com/namjaejeon/ksmbd).
With transport_rdma.* from restored from 6.17?
I just tested it and this issue does not occur on ksmbd rdma of the 6.17 kernel.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
6.17 or just transport_rdma.* from 6.17, but the rest from 6.18?
Can you also test with 6.17 +
fad988a2158d743da7971884b93482a73735b25eMaybe that changed things in order to let RDMA READs fail or cause a disconnect.The kernel version I tested was 6.17.9 and this patch was already applied.
Ah, good it also has:
smb: server: letsmb_direct_flush_send_list()invalidate a remote key firstQuoted 5 lines
Quoted 3 lines
Otherwise I'd suggest to test the following commits in order to find where the problem was introduced:
177368b9924314bde7d2ea6dc93de0d9ba728b61I don't have time to do this right now due to other work. Did you test it with a Windows client and can't find this issue?
I can only reproduce the problem this patchset is fixing, (recv completion before getting the ESTABLISHED callback).
I tested with an Intel-E810-CQDA2 card in RoCEv2 mode and a Windows 2025 server (acting as client against ksmbd).
And I can only reproduce the problem with the recv completion
before the ESTABLISHED event. So this patchset is not only
used for setups with a connectx-7, btw were you testing with infiniband or rocev2?
Quoted 5 lines
Quoted 2 lines
Otherwise copying a 2G and 5G file to and from the share works without problems.
I also tested with my latest smbdirect.ko patchset
in the for-6.19/fs-smb-20251125-v4 branch, also without problems.
I will test your latest smbdirect.ko patchset with my windows client and share the result with you.
Thanks.
Quoted 1 line
Stefan Metzmacher
reviewerAm 28.11.25 um 05:53 schrieb Steve French:
Quoted 35 lines · Namjae Jeon
Quoted 34 lines
Quoted 3 lines · Stefan Metzmacher
Am 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 1 line
On Wed, Nov 26, 2025 at 8:50 AM Namjae Jeon <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
On Tue, Nov 25, 2025 at 11:22 PM Stefan Metzmacher <[email protected]>
Quoted 16 lines · wrote:
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 4 lines
Quoted 2 lines
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Steve, There are more patches in ksmbd-for-next-next. Please apply the following 6 patches in #ksmbd-for-next-next to #ksmbd-for-next.
Quoted 10 lines
Quoted 10 lines
3858665313f1(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
ksmbd: ipc: fix use-after-free inipc_msg_send_requestb9c7d4fe6e93smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()6c5ceb636d08smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()d02a328304e5smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()340255e842d5smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper01cba263d1bdksmbd: vfs: fix race onm_flagsinvfs_cache
It seems these are the v2 patches, please use v3, the difference is that the __SMBDIRECT_SOCKET_DISCONNECT defines are moved up in order to let the patches on top work with out modifications. I noticed the difference while doing a rebase on ksmbd-for-next and get conflicts.
Thanks!
metze
Namjae Jeon
maintainerQuoted 48 lines · Stefan Metzmacher
Am 28.11.25 um 05:53 schrieb Steve French:
Quoted 35 lines · Namjae Jeon
Quoted 34 lines
Quoted 3 lines · Stefan Metzmacher
Am 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 1 line
On Wed, Nov 26, 2025 at 8:50 AM Namjae Jeon <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
On Tue, Nov 25, 2025 at 11:22 PM Stefan Metzmacher <[email protected]>
Quoted 16 lines · wrote:
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 4 lines
Quoted 2 lines
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Steve, There are more patches in ksmbd-for-next-next. Please apply the following 6 patches in #ksmbd-for-next-next to #ksmbd-for-next.
Quoted 10 lines
Quoted 10 lines
3858665313f1(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
ksmbd: ipc: fix use-after-free inipc_msg_send_requestb9c7d4fe6e93smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()6c5ceb636d08smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()d02a328304e5smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()340255e842d5smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper01cba263d1bdksmbd: vfs: fix race onm_flagsinvfs_cache
Quoted 5 lines
It seems these are the v2 patches, please use v3, the difference is that the
__SMBDIRECT_SOCKET_DISCONNECTdefines are moved up in order to let the patches on top work with out modifications. I noticed the difference while doing a rebase on ksmbd-for-next and get conflicts.
Right, Sorry for missing v3 patches.
Steve, Please apply updated 4 patches in ksmbd-for-next-next to ksmbd-for-next.
fc86cca6087f (HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
smb: client: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smbd_conn_upcall()111b7cb1b7f6 smb: server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in recv_done() and smb_direct_cm_handler() 12059ee95a5b smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()3658d5ac7908 smb: smbdirect: introduce SMBDIRECT_DEBUG_ERR_PTR() helper
Thanks.
Quoted 5 lines
Thanks!
metze
Stefan Metzmacher
reviewerAm 28.11.25 um 13:11 schrieb Namjae Jeon:
Quoted 58 lines · Stefan Metzmacher
Quoted 48 lines
Am 28.11.25 um 05:53 schrieb Steve French:
Quoted 35 lines · Namjae Jeon
Quoted 34 lines
Quoted 3 lines · Stefan Metzmacher
Am 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 1 line
On Wed, Nov 26, 2025 at 8:50 AM Namjae Jeon <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
On Tue, Nov 25, 2025 at 11:22 PM Stefan Metzmacher <[email protected]>
Quoted 16 lines · wrote:
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 4 lines
Quoted 2 lines
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Steve, There are more patches in ksmbd-for-next-next. Please apply the following 6 patches in #ksmbd-for-next-next to #ksmbd-for-next.
Quoted 10 lines
Quoted 10 lines
3858665313f1(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
ksmbd: ipc: fix use-after-free inipc_msg_send_requestb9c7d4fe6e93smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()6c5ceb636d08smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()d02a328304e5smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()340255e842d5smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper01cba263d1bdksmbd: vfs: fix race onm_flagsinvfs_cacheQuoted 5 lines
It seems these are the v2 patches, please use v3, the difference is that the
__SMBDIRECT_SOCKET_DISCONNECTdefines are moved up in order to let the patches on top work with out modifications. I noticed the difference while doing a rebase on ksmbd-for-next and get conflicts.Right, Sorry for missing v3 patches.
Steve, Please apply updated 4 patches in ksmbd-for-next-next to ksmbd-for-next.
Quoted 8 lines
fc86cca6087f(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()111b7cb1b7f6smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()12059ee95a5bsmb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()3658d5ac7908smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper
Given that we missed linux-next for this week anyway,
we could also add everything from my for-6.19/fs-smb-20251128-v5 branch, which is rebased on smfrench-smb3-kernel/ksmbd-for-next with the top 3 commits replaced by the top 3 commits from smfrench-smb3-kernel/ksmbd-for-next-next.
And has the patches from David's cifs-cleanup branch
as well as my smbdirect.ko patches.
metze
Namjae Jeon
maintainerQuoted 69 lines · Stefan Metzmacher
Am 28.11.25 um 13:11 schrieb Namjae Jeon:
Quoted 58 lines · Stefan Metzmacher
Quoted 48 lines
Am 28.11.25 um 05:53 schrieb Steve French:
Quoted 35 lines · Namjae Jeon
Quoted 34 lines
Quoted 3 lines · Stefan Metzmacher
Am 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 1 line
On Wed, Nov 26, 2025 at 8:50 AM Namjae Jeon <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
On Tue, Nov 25, 2025 at 11:22 PM Stefan Metzmacher <[email protected]>
Quoted 16 lines · wrote:
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 4 lines
Quoted 2 lines
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Steve, There are more patches in ksmbd-for-next-next. Please apply the following 6 patches in #ksmbd-for-next-next to #ksmbd-for-next.
Quoted 10 lines
Quoted 10 lines
3858665313f1(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
ksmbd: ipc: fix use-after-free inipc_msg_send_requestb9c7d4fe6e93smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()6c5ceb636d08smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()d02a328304e5smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()340255e842d5smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper01cba263d1bdksmbd: vfs: fix race onm_flagsinvfs_cacheQuoted 5 lines
It seems these are the v2 patches, please use v3, the difference is that the
__SMBDIRECT_SOCKET_DISCONNECTdefines are moved up in order to let the patches on top work with out modifications. I noticed the difference while doing a rebase on ksmbd-for-next and get conflicts.Right, Sorry for missing v3 patches.
Steve, Please apply updated 4 patches in ksmbd-for-next-next to ksmbd-for-next.
Quoted 8 lines
fc86cca6087f(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()111b7cb1b7f6smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()12059ee95a5bsmb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()3658d5ac7908smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper
Quoted 7 lines
Given that we missed linux-next for this week anyway,
we could also add everything from my for-6.19/fs-smb-20251128-v5 branch, which is rebased on smfrench-smb3-kernel/ksmbd-for-next with the top 3 commits replaced by the top 3 commits from smfrench-smb3-kernel/ksmbd-for-next-next.
And has the patches from David's cifs-cleanup branch
as well as my smbdirect.ko patches.
I have added stable tags to the top 4 patches in ksmbd-for-next-next so they can be applied into 6.18.
Cc: [email protected] # v6.18
Quoted 2 lines
metze
i only see changes in two of the patches (see below) - will update ksmbd-for-next to include the version from your branch (for-6.19/fs-smb-20251128-v5). Does that match what you saw?
smfrench@smfrench-ThinkPad-P16s-Gen-2:~/smb3-kernel/6-11-27-25$ diff 0004-smb-server-relax-WARN_ON_ONCE-SMBDIRECT_SOCKET_-chec.patch ~/metze/wip/197/0039-smb-server-relax-WARN_ON_ONCE-SMBDIRECT_SOCKET_-chec.patch 1c1 < From 225825bffc9602e34e26199f1c635ee59c5de2e4 Mon Sep 17 00:00:00 2001 ---
Quoted 1 line
From
0ee0418c34b31975ffe76d8d6d93ebbe9600c532Mon Sep 17 00:00:00 2001
3,4c3,4
< Date: Tue, 25 Nov 2025 09:55:56 +0100
< Subject: [PATCH 4/6] smb: server: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*)
---
Quoted 2 lines
Date: Tue, 25 Nov 2025 15:21:53 +0100
Subject: [PATCH 039/197] smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)
168,169c168,169
< fs/smb/server/transport_rdma.c | 39 +++++++++++++++++++++++++++------- < 1 file changed, 31 insertions(+), 8 deletions(-)
---
Quoted 2 lines
fs/smb/server/transport_rdma.c | 40 +++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-)
172c172
< index e2be9a496154..2d360fd08f5f 100644
---
Quoted 1 line
index
e2be9a496154..4e7ab8d9314f100644
175c175,184
< @@ -231,6 +231,9 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)
---
Review static void smb_direct_disconnect_rdma_work(struct work_struct *work)
Quoted 10 lines
(quoted diff) +2
-0@@ -19,6 +19,8 @@ #include <rdma/rdma_cm.h> #include <rdma/rw.h> +#define __SMBDIRECT_SOCKET_DISCONNECT(__sc) smb_direct_disconnect_rdma_connection(__sc) + #include "glob.h" #include "connection.h" #include "smb_common.h"@@ -231,6 +233,9 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)
185c194
< @@ -241,9 +244,6 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)
---
Review static void smb_direct_disconnect_rdma_work(struct work_struct *work)
Quoted 1 line
(quoted diff) +0
-0@@ -241,9 +246,6 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)
195,199c204
< @@ -284,9 +284,13 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work) < smb_direct_disconnect_wake_up_all(sc);
< }
<
< +#define __SMBDIRECT_SOCKET_DISCONNECT(__sc) smb_direct_disconnect_rdma_connection(__sc)
---
Review static void smb_direct_disconnect_rdma_work(struct work_struct *work)
Quoted 1 line
(quoted diff) +0
-0@@ -287,6 +289,9 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)
209c214
< @@ -296,9 +300,6 @@ smb_direct_disconnect_rdma_connection(struct smbdirect_socket *sc)
---
Review smb_direct_disconnect_rdma_connection(struct smbdirect_socket *sc)
Quoted 1 line
(quoted diff) +0
-0@@ -296,9 +301,6 @@ smb_direct_disconnect_rdma_connection(struct smbdirect_socket *sc)
219c224
< @@ -639,7 +640,18 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
---
Review static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
Quoted 1 line
(quoted diff) +0
-0@@ -639,7 +641,18 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
239c244
< @@ -1725,7 +1737,18 @@ static int smb_direct_cm_handler(struct rdma_cm_id *cm_id,
---
Review static int smb_direct_cm_handler(struct rdma_cm_id *cm_id,
Quoted 1 line
(quoted diff) +0
-0@@ -1725,7 +1738,18 @@ static int smb_direct_cm_handler(struct rdma_cm_id *cm_id,
smfrench@smfrench-ThinkPad-P16s-Gen-2:~/smb3-kernel/6-11-27-25$ diff 0005-smb-client-relax-WARN_ON_ONCE-SMBDIRECT_SOCKET_-chec.patch ~/metze/wip/197/0040-smb-client-relax-WARN_ON_ONCE-SMBDIRECT_SOCKET_-chec.patch 1c1 < From 76e8c8c28af17cf66e79beea48278dd5b5ed5d52 Mon Sep 17 00:00:00 2001 ---
Quoted 1 line
From
1e5535ff36f83e8cd664fc6d9d318b482a0ff9d8Mon Sep 17 00:00:00 2001
3,4c3,4
< Date: Tue, 25 Nov 2025 09:55:57 +0100
< Subject: [PATCH 5/6] smb: client: relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*)
---
Quoted 2 lines
Date: Tue, 25 Nov 2025 15:21:54 +0100
Subject: [PATCH 040/197] smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)
46c46
< index c6c428c2e08d..9ee8d1048284 100644
---
Quoted 1 line
index
c6c428c2e08d..788a0670c4a8100644
49c49,57
< @@ -186,6 +186,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
---
Review static void smbd_disconnect_rdma_work(struct work_struct *work)
Quoted 9 lines
(quoted diff) +1
-0@@ -7,6 +7,7 @@ #include <linux/module.h> #include <linux/highmem.h> #include <linux/folio_queue.h> +#define __SMBDIRECT_SOCKET_DISCONNECT(__sc) smbd_disconnect_rdma_connection(__sc) #include "../common/smbdirect/smbdirect_pdu.h" #include "smbdirect.h" #include "cifs_debug.h"@@ -186,6 +187,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
59c67
< @@ -197,9 +200,6 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
---
Review static void smbd_disconnect_rdma_work(struct work_struct *work)
Quoted 1 line
(quoted diff) +0
-0@@ -197,9 +201,6 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
69,71c77
< @@ -240,8 +240,12 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
< smbd_disconnect_wake_up_all(sc);
< }
---
Review static void smbd_disconnect_rdma_work(struct work_struct *work)
Quoted 1 line
(quoted diff) +0
-0@@ -242,6 +243,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
73d78
< +#define __SMBDIRECT_SOCKET_DISCONNECT(__sc)smbd_disconnect_rdma_connection(__sc)
Quoted 57 lines · Stefan Metzmacher
Am 28.11.25 um 05:53 schrieb Steve French:
Quoted 35 lines · Namjae Jeon
Quoted 34 lines
Quoted 3 lines · Stefan Metzmacher
Am 26.11.25 um 02:07 schrieb Namjae Jeon:
Quoted 1 line
On Wed, Nov 26, 2025 at 8:50 AM Namjae Jeon <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
On Tue, Nov 25, 2025 at 11:22 PM Stefan Metzmacher <[email protected]>
Quoted 16 lines · wrote:
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Hi,
here are some small cleanups for a problem Nanjae reported, where two
WARN_ON_ONCE(sc->status != ...)checks where triggered by a Windows 11 client.The patches should relax the checks if an error happened before, they are intended for 6.18 final, as far as I can see the problem was introduced during the 6.18 cycle only.
Given that v1 of this patchset produced a very useful
WARN_ONCE()message, I'd really propose to keep this for 6.18, also for the client where the actual problem may not exists, but if they exist, it will be useful to have the more useful messages in 6.16 final.Quoted 4 lines
Quoted 2 lines
Anyway, Applied this patch-set to #ksmbd-for-next-next. Please check the below issue.
Steve, can you move this into ksmbd-for-next?
Steve, There are more patches in ksmbd-for-next-next. Please apply the following 6 patches in #ksmbd-for-next-next to #ksmbd-for-next.
Quoted 10 lines
Quoted 10 lines
3858665313f1(HEAD -> ksmbd-for-next-next, origin/ksmbd-for-next-next)
ksmbd: ipc: fix use-after-free inipc_msg_send_requestb9c7d4fe6e93smb: client: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmbd_conn_upcall()6c5ceb636d08smb: server: relaxWARN_ON_ONCE(SMBDIRECT_SOCKET_*)checks inrecv_done()andsmb_direct_cm_handler()d02a328304e5smb: smbdirect: introduce SMBDIRECT_CHECK_STATUS_{WARN,DISCONNECT}()340255e842d5smb: smbdirect: introduceSMBDIRECT_DEBUG_ERR_PTR()helper01cba263d1bdksmbd: vfs: fix race onm_flagsinvfs_cacheIt seems these are the v2 patches, please use v3, the difference is that the
__SMBDIRECT_SOCKET_DISCONNECTdefines are moved up in order to let the patches on top work with out modifications. I noticed the difference while doing a rebase on ksmbd-for-next and get conflicts.Thanks!
metze
Signature · 3 lines
Thanks, Steve