From 500edcada7e4101a21a28078611597fdb50b4791 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Wed, 24 Apr 2019 23:13:29 +0800 Subject: [PATCH] LU-12043 llite, readahead: fix to call ll_ras_enter() properly ll_ras_enter() is expected to be called per syscall. However, with fast read enabled, it will be no longer true that We will call vvp_io_read_start() for every syscall. To fix this problem, we should move this to file read handler. Change-Id: I8d70714b2e8bc04b7c4ab996d189f10f37488d97 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/34755 Tested-by: Jenkins Reviewed-by: Patrick Farrell Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/llite/file.c | 4 ++++ lustre/llite/vvp_io.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 4d39246..b5b09d9 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1612,6 +1612,8 @@ static ssize_t ll_file_read_iter(struct kiocb *iocb, struct iov_iter *to) ssize_t rc2; __u16 refcheck; + ll_ras_enter(iocb->ki_filp); + result = ll_do_fast_read(iocb, to); if (result < 0 || iov_iter_count(to) == 0) GOTO(out, result); @@ -1889,6 +1891,8 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos, __u16 refcheck; ENTRY; + ll_ras_enter(in_file); + env = cl_env_get(&refcheck); if (IS_ERR(env)) RETURN(PTR_ERR(env)); diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 39b308e..b641fa9 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -803,7 +803,6 @@ static int vvp_io_read_start(const struct lu_env *env, vio->vui_ra_valid = true; vio->vui_ra_start = cl_index(obj, pos); vio->vui_ra_count = cl_index(obj, tot + PAGE_SIZE - 1); - ll_ras_enter(file); } /* BUG: 5972 */ -- 1.8.3.1