Whamcloud - gitweb
LU-13745 pcc: fall back normal splice read for detached file 96/40396/3
authorQian Yingjin <qian@ddn.com>
Mon, 26 Oct 2020 02:37:26 +0000 (10:37 +0800)
committerQian Yingjin <qian@ddn.com>
Mon, 7 Dec 2020 03:27:38 +0000 (11:27 +0800)
For the file that was once cached into PCC but detached from PCC
later, it should fall back into the normal I/O path to direct I/Os
to Lustre OSTs for splice read, not just return zero.

Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Iff3449069a0a12ac56b58618e474749361c31bb7

lustre/llite/pcc.c

index cfad000..c51a735 100644 (file)
@@ -1806,14 +1806,14 @@ ssize_t pcc_file_splice_read(struct file *in_file, loff_t *ppos,
 
        ENTRY;
 
-       if (!pcc_file) {
+       if (!pcc_file)
                RETURN(default_file_splice_read(in_file, ppos, pipe,
-                      count, flags));
-       }
+                                               count, flags));
 
        pcc_io_init(inode, PIT_SPLICE_READ, &cached);
        if (!cached)
-               RETURN(0);
+               RETURN(default_file_splice_read(in_file, ppos, pipe,
+                                               count, flags));
 
        result = default_file_splice_read(pcc_file, ppos, pipe, count, flags);