[lustre-devel] [PATCH 14/27] lustre: llite: Return errors for aio

James Simmons jsimmons at infradead.org
Sun Jun 13 16:11:24 PDT 2021


From: Patrick Farrell <farr0186 at gmail.com>

The aio code incorrectly discards errors from
ll_direct_rw_pages.  Fix this and add a test for this.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14687
Lustre-commit: 3e1f8d30cb0209b3 ("LU-14687 llite: Return errors for aio")
Signed-off-by: Patrick Farrell <farr0186 at gmail.com>
Reviewed-on: https://review.whamcloud.com/43722
Reviewed-by: Arshad Hussain <arshad.hussain at aeoncomputing.com>
Reviewed-by: Wang Shilong <wshilong at whamcloud.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/include/obd_support.h | 1 +
 fs/lustre/llite/rw26.c          | 3 ++-
 fs/lustre/obdclass/cl_page.c    | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index 962a99b..188e552 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -479,6 +479,7 @@
 #define OBD_FAIL_LLITE_SHORT_COMMIT			0x1415
 #define OBD_FAIL_LLITE_CREATE_FILE_PAUSE2		0x1416
 #define OBD_FAIL_LLITE_RACE_MOUNT			0x1417
+#define OBD_FAIL_LLITE_PAGE_ALLOC			0x1418
 
 #define OBD_FAIL_FID_INDIR				0x1501
 #define OBD_FAIL_FID_INLMA				0x1502
diff --git a/fs/lustre/llite/rw26.c b/fs/lustre/llite/rw26.c
index 74f3b0b..2de956d 100644
--- a/fs/lustre/llite/rw26.c
+++ b/fs/lustre/llite/rw26.c
@@ -435,7 +435,8 @@ static ssize_t ll_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
 			vio->u.readwrite.vui_written += tot_bytes;
 		else
 			vio->u.readwrite.vui_read += tot_bytes;
-		result = -EIOCBQUEUED;
+		if (result == 0)
+			result = -EIOCBQUEUED;
 	}
 
 	return result;
diff --git a/fs/lustre/obdclass/cl_page.c b/fs/lustre/obdclass/cl_page.c
index 4b6386c..1c9e91d 100644
--- a/fs/lustre/obdclass/cl_page.c
+++ b/fs/lustre/obdclass/cl_page.c
@@ -158,6 +158,9 @@ static struct cl_page *__cl_page_alloc(struct cl_object *o)
 	struct cl_page *cl_page = NULL;
 	unsigned short bufsize = cl_object_header(o)->coh_page_bufsize;
 
+	if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_PAGE_ALLOC))
+		return NULL;
+
 check:
 	/* the number of entries in cl_page_kmem_array is expected to
 	 * only be 2-3 entries, so the lookup overhead should be low.
-- 
1.8.3.1



More information about the lustre-devel mailing list