s3: smbd: Fix schedule_aio_smb2_write() to allow the last write in a compound to...
authorJeremy Allison <jra@samba.org>
Fri, 18 Nov 2022 18:45:19 +0000 (10:45 -0800)
committerRalph Boehme <slow@samba.org>
Thu, 1 Dec 2022 15:04:58 +0000 (15:04 +0000)
Remove knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
selftest/knownfail.d/compound_async
source3/smbd/smb2_aio.c

index 797b61ca6381c34ee4b5ca43cb58eef5bfe86b8a..ee987713ba0b3cda179169e473737fe5f192e266 100644 (file)
@@ -1,2 +1 @@
-^samba3.smb2.compound_async.write_write\(fileserver\)
 ^samba3.smb2.compound_async.read_read\(fileserver\)
index 76a5b644ef8671c7934de511f13c82deb6270ae9..6b04063ba30d6f1f0ebdbd9fb9da64272aa45657 100644 (file)
@@ -433,6 +433,8 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
        struct aio_extra *aio_ex = NULL;
        size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
        struct tevent_req *req;
+       bool is_compound = false;
+       bool is_last_in_compound = false;
 
        if (fsp_is_alternate_stream(fsp)) {
                /* No AIO on streams yet */
@@ -455,7 +457,14 @@ NTSTATUS schedule_aio_smb2_write(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;
        }