Whamcloud - gitweb
LU-12718 obdclass: Allow read-ahead for write requests 00/36000/9
authorMr NeilBrown <neilb@suse.com>
Thu, 5 Dec 2019 13:51:21 +0000 (08:51 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 14 Dec 2019 05:59:13 +0000 (05:59 +0000)
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 <neilb@suse.com>
Change-Id: I7aa1efb4fc8bb6f8474596a6194fc39f484d7ac7
Reviewed-on: https://review.whamcloud.com/36000
Reviewed-by: Shilong Wang <wshilong@ddn.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/cl_io.c

index c4a0fd7..910d474 100644 (file)
@@ -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;