Whamcloud - gitweb
LU-12043 llite, readahead: fix to call ll_ras_enter() properly 55/34755/2
authorWang Shilong <wshilong@ddn.com>
Wed, 24 Apr 2019 15:13:29 +0000 (23:13 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 4 May 2019 05:57:31 +0000 (05:57 +0000)
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 <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/34755
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@gmail.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/llite/vvp_io.c

index 4d39246..b5b09d9 100644 (file)
@@ -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));
index 39b308e..b641fa9 100644 (file)
@@ -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 */