[lustre-devel] [PATCH 09/27] lustre: llite: skip fast reads if layout is invalid
James Simmons <[email protected]> Fri, 21 Mar 2025 09:06:52 -0400
| Newsgroups | org.lustre.lists.lustre-devel |
|---|---|
| Message-ID | <[email protected]> |
From: Alex Zhuravlev <[email protected]> don't let fast reads from the pagecache if the layout is not valid. WC-bug-id: https://jira.whamcloud.com/browse/LU-15431 Lustre-commit: fe2fafa1af7edc251 ("LU-15431 llite: skip fast reads if layout is invalid") Signed-off-by: Alex Zhuravlev <[email protected]> Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/46282 Reviewed-by: Andreas Dilger <[email protected]> Reviewed-by: Patrick Farrell <[email protected]> Reviewed-by: Oleg Drokin <[email protected]> Signed-off-by: James Simmons <[email protected]> --- fs/lustre/llite/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c index 448aea7ceb12..c7f77295d3b3 100644 --- a/fs/lustre/llite/file.c +++ b/fs/lustre/llite/file.c @@ -1983,6 +1983,7 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args, static ssize_t ll_do_fast_read(struct kiocb *iocb, struct iov_iter *iter) { + struct ll_inode_info *lli = ll_i2info(file_inode(iocb->ki_filp)); ssize_t result; if (!ll_sbi_has_fast_read(ll_i2sbi(file_inode(iocb->ki_filp)))) @@ -1995,6 +1996,9 @@ ll_do_fast_read(struct kiocb *iocb, struct iov_iter *iter) if (iocb->ki_filp->f_flags & O_DIRECT) return 0; + if (ll_layout_version_get(lli) == CL_LAYOUT_GEN_NONE) + return 0; + result = generic_file_read_iter(iocb, iter); /* If the first page is not in cache, generic_file_aio_read() will be -- 2.39.3 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org