[lustre-devel] [PATCH 01/25] lustre: llite: avoid stale data reading

James Simmons jsimmons at infradead.org
Mon Aug 2 12:50:21 PDT 2021


From: Wang Shilong <wshilong at ddn.com>

remove_mapping() can prohibit to kill page from page cache due page
refcount!=2, in vvp_page_delete() clear uptodate flag in case
stale data reading later.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14541
Lustre-commit: f2a16793fa4316fc9cc ("LU-14541 llite: avoid stale data reading")
Signed-off-by: Wang Shilong <wshilong at ddn.com>
Reviewed-on: https://review.whamcloud.com/43476
Reviewed-by: Patrick Farrell <pfarrell at whamcloud.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli at ddn.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/vvp_page.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/lustre/llite/vvp_page.c b/fs/lustre/llite/vvp_page.c
index 86353df..2ecd414 100644
--- a/fs/lustre/llite/vvp_page.c
+++ b/fs/lustre/llite/vvp_page.c
@@ -172,6 +172,12 @@ static void vvp_page_delete(const struct lu_env *env,
 
 	ClearPagePrivate(vmpage);
 	vmpage->private = 0;
+
+	/**
+	 * Vmpage might not be released due page refcount != 2,
+	 * clear Page uptodate here to avoid stale data.
+	 */
+	ClearPageUptodate(vmpage);
 	/*
 	 * Reference from vmpage to cl_page is removed, but the reference back
 	 * is still here. It is removed later in vvp_page_fini().
-- 
1.8.3.1



More information about the lustre-devel mailing list