From 39df9f4a593f4dd1f19c8b720fd7fd55081c29d1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Nov 2022 10:50:35 -0800 Subject: [PATCH] s3: smbd: Fix schedule_smb2_aio_read() to allow the last read in a compound to go async. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove knownfail. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Thu Dec 1 16:04:07 UTC 2022 on sn-devel-184 --- selftest/knownfail.d/compound_async | 1 - source3/smbd/smb2_aio.c | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 selftest/knownfail.d/compound_async diff --git a/selftest/knownfail.d/compound_async b/selftest/knownfail.d/compound_async deleted file mode 100644 index ee987713ba0..00000000000 --- a/selftest/knownfail.d/compound_async +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.compound_async.read_read\(fileserver\) diff --git a/source3/smbd/smb2_aio.c b/source3/smbd/smb2_aio.c index 6b04063ba30..8c01c76a3e9 100644 --- a/source3/smbd/smb2_aio.c +++ b/source3/smbd/smb2_aio.c @@ -289,6 +289,8 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn, struct aio_extra *aio_ex; size_t min_aio_read_size = lp_aio_read_size(SNUM(conn)); struct tevent_req *req; + bool is_compound = false; + bool is_last_in_compound = false; bool ok; ok = vfs_valid_pread_range(startpos, smb_maxcnt); @@ -316,7 +318,14 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn, return NT_STATUS_RETRY; } - if (smbd_smb2_is_compound(smbreq->smb2req)) { + is_compound = smbd_smb2_is_compound(smbreq->smb2req); + is_last_in_compound = smbd_smb2_is_last_in_compound(smbreq->smb2req); + + if (is_compound && !is_last_in_compound) { + /* + * Only allow going async if this is the last + * request in a compound. + */ return NT_STATUS_RETRY; } -- 2.11.4.GIT