From 45549983d4b288471812821197a3a394bf910321 Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Sat, 31 Jul 2021 15:45:56 +0800 Subject: [PATCH] LU-14709 pcc: VM_WRITE should not trigger layout write VM area marked with VM_WRITE means that pages may be written, but mmap page write may never happen. It should delay layout write until the actual modification on the file happen in ->page_mkwrite(). Otherwise, it will trigger panic for PCC-RO sanity-pcc test_21f(). Lustre-change: https://review.whamcloud.com/44483 Lustre-commit: TBD (from de1fe260d8c88112b46857d69cf5fe9e5d06cfbd) Fixes: f2d1c4ee4 ("LU-14647 flr: mmap write/punch does not stale other mirrors") Signed-off-by: Qian Yingjin Change-Id: I1cbfef8a4ed7e2c718324fd8a21bafd6157b5f0c Reviewed-on: https://review.whamcloud.com/44452 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Andreas Dilger --- lustre/include/cl_object.h | 5 ----- lustre/llite/llite_mmap.c | 3 --- lustre/llite/vvp_io.c | 3 +-- lustre/lov/lov_io.c | 6 ++---- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index d1b9f22..8001fbb 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -2461,11 +2461,6 @@ static inline int cl_io_is_mkwrite(const struct cl_io *io) return io->ci_type == CIT_FAULT && io->u.ci_fault.ft_mkwrite; } -static inline int cl_io_is_fault_writable(const struct cl_io *io) -{ - return io->ci_type == CIT_FAULT && io->u.ci_fault.ft_writable; -} - /** * True, iff \a io is a truncate(2). */ diff --git a/lustre/llite/llite_mmap.c b/lustre/llite/llite_mmap.c index 4752ec6..871a3bd 100644 --- a/lustre/llite/llite_mmap.c +++ b/lustre/llite/llite_mmap.c @@ -119,9 +119,6 @@ restart: else if (vma->vm_flags & VM_RAND_READ) io->ci_rand_read = 1; - if (vma->vm_flags & VM_WRITE) - fio->ft_writable = 1; - rc = cl_io_init(env, io, CIT_FAULT, io->ci_obj); if (rc == 0) { struct vvp_io *vio = vvp_env_io(env); diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 06f730b..b7062b8 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -367,8 +367,7 @@ static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios) io->ci_need_write_intent = 0; LASSERT(io->ci_type == CIT_WRITE || cl_io_is_fallocate(io) || - cl_io_is_trunc(io) || cl_io_is_mkwrite(io) || - cl_io_is_fault_writable(io)); + cl_io_is_trunc(io) || cl_io_is_mkwrite(io)); CDEBUG(D_VFSTRACE, DFID" write layout, type %u "DEXT"\n", PFID(lu_object_fid(&obj->co_lu)), io->ci_type, diff --git a/lustre/lov/lov_io.c b/lustre/lov/lov_io.c index 832432a..b917efb 100644 --- a/lustre/lov/lov_io.c +++ b/lustre/lov/lov_io.c @@ -228,8 +228,7 @@ static int lov_io_mirror_write_intent(struct lov_io *lio, io->ci_need_write_intent = 0; if (!(io->ci_type == CIT_WRITE || cl_io_is_mkwrite(io) || - cl_io_is_fallocate(io) || cl_io_is_trunc(io) || - cl_io_is_fault_writable(io))) + cl_io_is_fallocate(io) || cl_io_is_trunc(io))) RETURN(0); /* @@ -602,8 +601,7 @@ static int lov_io_slice_init(struct lov_io *lio, /* check if it needs to instantiate layout */ if (!(io->ci_type == CIT_WRITE || cl_io_is_mkwrite(io) || cl_io_is_fallocate(io) || - (cl_io_is_trunc(io) && io->u.ci_setattr.sa_attr.lvb_size > 0)) || - cl_io_is_fault_writable(io)) + (cl_io_is_trunc(io) && io->u.ci_setattr.sa_attr.lvb_size > 0))) GOTO(out, result = 0); /* -- 1.8.3.1