Whamcloud - gitweb
LU-13805 llite: Fix return for non-queued aio
authorPatrick Farrell <pfarrell@whamcloud.com>
Fri, 15 Dec 2023 20:48:53 +0000 (15:48 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 30 May 2024 00:41:44 +0000 (00:41 +0000)
commita6859830813e20f3f96e1c9edfa17d32877cd6dd
treeb9f7be02b974d7e2aa0ab52fe37ddbe7fa334f1d
parent5b54c37962031d6c92971d5a96eabb84e5aa8c7a
LU-13805 llite: Fix return for non-queued aio

If an AIO fails or is completed synchronously (even
partially), the VFS will handle calling the completion
callback to finish the AIO, and so Lustre needs to return
the number of bytes successfully completed to the VFS.

This fixes a bug where if an AIO was racing with buffered
I/O, the AIO would fall back to buffered I/O, causing it to
complete before returning to the VFS rather than being
queued.  In this case, Lustre would return 0 the VFS, and
the VFS would complete the AIO and report 0 bytes moved.

This fixes the logic for this.

Lustre-Commit: 8a5bb81f774b9d41f1009b07010372fa9cd03a62
Lustre-Change: https://review.whamcloud.com/49915

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I9306402201e2962bbff04a4264c37bd0f1eca7b7
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53696
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/file.c
lustre/llite/rw26.c
lustre/tests/sanity.sh