Skip to contentSkip to conversation

cifs: Fix the smb1 readv callback to correctly call netfs

PATCH In review David Howells 4 participants 4 messages Feb 25, 2025

Subsystems (4)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 cifs: Fix the smb1 readv callback to correctly call netfs

Fix cifs_readv_callback() to call netfs_read_subreq_terminated() rather than queuing the subrequest work item (which is unset). Also call the I/O progress tracepoint.

Fixes e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")
cc Steve French <[email protected]>
cc Pali Rohár <[email protected]>
cc Paulo Alcantara <[email protected]>
cc Jeff Layton <[email protected]>
---
 fs/smb/client/cifssmb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/client/cifssmb.c +2 -1
index 6a3e287eabfa..bf9acea53ccb 100644
@@ -1338,7 +1338,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
 	rdata->credits.value = 0;
 	rdata->subreq.error = rdata->result;
 	rdata->subreq.transferred += rdata->got_bytes;
-	queue_work(cifsiod_wq, &rdata->subreq.work);
+	trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);
+	netfs_read_subreq_terminated(&rdata->subreq);
 	release_mid(mid);
 	add_credits(server, &credits, 0);
 }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · David Howells

Fix cifs_readv_callback() to call netfs_read_subreq_terminated() rather than queuing the subrequest work item (which is unset). Also call the I/O progress tracepoint.

Fixes e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")
cc Steve French <[email protected]>
cc Pali Rohár <[email protected]>
cc Paulo Alcantara <[email protected]>
cc Jeff Layton <[email protected]>
Quoted 3 lines
---
 fs/smb/client/cifssmb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Tested-by on v1 1/1
#2 lore raw
In reply to David Howells
Quoted 5 lines · On Tuesday 25 February 2025 22:25:00 David Howells wrote:

Fix cifs_readv_callback() to call netfs_read_subreq_terminated() rather than queuing the subrequest work item (which is unset). Also call the I/O progress tracepoint.

Quoted 11 lines
Fixes e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")
cc Steve French <[email protected]>
cc Pali Rohár <[email protected]>
cc Paulo Alcantara <[email protected]>
cc Jeff Layton <[email protected]>

Thanks! With this change, I cannot reproduce crash anymore.

Steve, could you please include this fix into some queue? This should be merged into next -rc.

Quoted 19 lines
---
 fs/smb/client/cifssmb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/client/cifssmb.c +2 -1
index 6a3e287eabfa..bf9acea53ccb 100644
@@ -1338,7 +1338,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
 	rdata->credits.value = 0;
 	rdata->subreq.error = rdata->result;
 	rdata->subreq.transferred += rdata->got_bytes;
-	queue_work(cifsiod_wq, &rdata->subreq.work);
+	trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);
+	netfs_read_subreq_terminated(&rdata->subreq);
 	release_mid(mid);
 	add_credits(server, &credits, 0);
 }
#3 lore raw

Thanks for the quick fix and reviews/testing. Merged into cifs-2.6.git for-next. Will run some additional tests on it tonight

Quoted 46 lines · Pali Rohár
Quoted 5 lines · On Tuesday 25 February 2025 22:25:00 David Howells wrote:

Fix cifs_readv_callback() to call netfs_read_subreq_terminated() rather than queuing the subrequest work item (which is unset). Also call the I/O progress tracepoint.

Quoted 11 lines
Fixes e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")
cc Steve French <[email protected]>
cc Pali Rohár <[email protected]>
cc Paulo Alcantara <[email protected]>
cc Jeff Layton <[email protected]>

Thanks! With this change, I cannot reproduce crash anymore.

Steve, could you please include this fix into some queue? This should be merged into next -rc.

Quoted 19 lines
---
 fs/smb/client/cifssmb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/client/cifssmb.c +2 -1
index 6a3e287eabfa..bf9acea53ccb 100644
@@ -1338,7 +1338,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
      rdata->credits.value = 0;
      rdata->subreq.error = rdata->result;
      rdata->subreq.transferred += rdata->got_bytes;
-     queue_work(cifsiod_wq, &rdata->subreq.work);
+     trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);
+     netfs_read_subreq_terminated(&rdata->subreq);
      release_mid(mid);
      add_credits(server, &credits, 0);
 }
Signature · 3 lines
Thanks,

Steve