From 514bd936d06141319fb5e8032e4b7fa7bc0d1194 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Thu, 5 Dec 2019 08:51:21 -0500 Subject: [PATCH] LU-12718 obdclass: Allow read-ahead for write requests cl_io_read_ahead asserts that read-ahead can only happen due to CIT_READ or CIT_FAULT requests. Since LU-9618, we expect CIT_WRITE requests to also sometimes trigger read-ahead. So the LINVRNT() needs to be extended to acknowledge that. Signed-off-by: Mr NeilBrown Change-Id: I7aa1efb4fc8bb6f8474596a6194fc39f484d7ac7 Reviewed-on: https://review.whamcloud.com/36000 Reviewed-by: Shilong Wang Reviewed-by: Patrick Farrell Reviewed-by: Neil Brown Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/obdclass/cl_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index c4a0fd7..910d474 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -562,7 +562,9 @@ int cl_io_read_ahead(const struct lu_env *env, struct cl_io *io, const struct cl_io_slice *scan; int result = 0; - LINVRNT(io->ci_type == CIT_READ || io->ci_type == CIT_FAULT); + LINVRNT(io->ci_type == CIT_READ || + io->ci_type == CIT_FAULT || + io->ci_type == CIT_WRITE); LINVRNT(io->ci_state == CIS_IO_GOING || io->ci_state == CIS_LOCKED); LINVRNT(cl_io_invariant(io)); ENTRY; -- 1.8.3.1