Skip to content

Commit ce5291e

Browse files
dhowellsSteve French
authored andcommitted
cifs: Defer read completion
Defer read completion from the I/O thread to the cifsiod thread so as not to slow down the I/O thread. This restores the behaviour of v6.9. Fixes: 3ee1a1f ("cifs: Cut over to using netfslib") Signed-off-by: David Howells <dhowells@redhat.com> cc: Paulo Alcantara <pc@manguebit.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 8bf0287 commit ce5291e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4484,6 +4484,16 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
44844484
return rc;
44854485
}
44864486

4487+
static void smb2_readv_worker(struct work_struct *work)
4488+
{
4489+
struct cifs_io_subrequest *rdata =
4490+
container_of(work, struct cifs_io_subrequest, subreq.work);
4491+
4492+
netfs_subreq_terminated(&rdata->subreq,
4493+
(rdata->result == 0 || rdata->result == -EAGAIN) ?
4494+
rdata->got_bytes : rdata->result, true);
4495+
}
4496+
44874497
static void
44884498
smb2_readv_callback(struct mid_q_entry *mid)
44894499
{
@@ -4578,9 +4588,8 @@ smb2_readv_callback(struct mid_q_entry *mid)
45784588
rdata->result = 0;
45794589
}
45804590
rdata->credits.value = 0;
4581-
netfs_subreq_terminated(&rdata->subreq,
4582-
(rdata->result == 0 || rdata->result == -EAGAIN) ?
4583-
rdata->got_bytes : rdata->result, true);
4591+
INIT_WORK(&rdata->subreq.work, smb2_readv_worker);
4592+
queue_work(cifsiod_wq, &rdata->subreq.work);
45844593
release_mid(mid);
45854594
add_credits(server, &credits, 0);
45864595
}

0 commit comments

Comments
 (0)