Whamcloud - gitweb
LU-13805 llite: Fix return for non-queued aio 15/49915/17
authorPatrick Farrell <pfarrell@whamcloud.com>
Fri, 31 Mar 2023 20:34:33 +0000 (16:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 May 2023 19:02:14 +0000 (19:02 +0000)
commit8a5bb81f774b9d41f1009b07010372fa9cd03a62
tree13d487046b5655354762fcb2896522012a1ddbd1
parent151650e468ab423e831c30d635ea380e0434a122
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.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I9306402201e2962bbff04a4264c37bd0f1eca7b7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49915
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Zhenyu Xu <bobijam@hotmail.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/llite/rw26.c
lustre/tests/sanity.sh