From patchwork Mon May 25 22:07:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11569543 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 219E060D for ; Mon, 25 May 2020 22:09:19 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B1D52071A for ; Mon, 25 May 2020 22:09:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B1D52071A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id EC97D247275; Mon, 25 May 2020 15:08:58 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 4572921FE49 for ; Mon, 25 May 2020 15:08:35 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 23FD31005865; Mon, 25 May 2020 18:08:27 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 2351449D; Mon, 25 May 2020 18:08:27 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 25 May 2020 18:07:53 -0400 Message-Id: <1590444502-20533-17-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1590444502-20533-1-git-send-email-jsimmons@infradead.org> References: <1590444502-20533-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 16/45] lustre: llite: do not flush COW pages from mapping X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Bobi Jam Do not flush COW pages from an executable mapping, as this will cause running binaries to segfault when mapped pages disappear under them. This was modified to allow non-blocking PCC caching, but triggers immediate segfaults for binaries when the DLM locks are revoked, even when PCC is not in use. The added test case failed 100% without this patch. This patch is only a partial fix to avoid the segfaults. There still needs to be something done to re-introduce the PCC functionality, but should be conditional on PCC enabled, and not for running binaries. There is a problem for PCC when multiple clients read/write on a shared mmapped file. We exclude mmap_sanity tst6 in test_4 from PCC testing temporarily. Fixes: 38a1a6ad3f79 ("lustre: pcc: Non-blocking PCC caching") WC-bug-id: https://jira.whamcloud.com/browse/LU-13137 Lustre-commit: 13a0066afb8d8 ("LU-13137 llite: do not flush COW pages from mapping") Signed-off-by: Bobi Jam Reviewed-on: https://review.whamcloud.com/37278 Reviewed-by: Andreas Dilger Reviewed-by: Yingjin Qian Reviewed-by: Stephan Thiell Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/llite/llite_mmap.c | 2 +- fs/lustre/llite/vvp_object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/lustre/llite/llite_mmap.c b/fs/lustre/llite/llite_mmap.c index ee1bff1..f77b8f9 100644 --- a/fs/lustre/llite/llite_mmap.c +++ b/fs/lustre/llite/llite_mmap.c @@ -519,7 +519,7 @@ int ll_teardown_mmaps(struct address_space *mapping, u64 first, u64 last) if (mapping_mapped(mapping)) { rc = 0; unmap_mapping_range(mapping, first + PAGE_SIZE - 1, - last - first + 1, 1); + last - first + 1, 0); } return rc; diff --git a/fs/lustre/llite/vvp_object.c b/fs/lustre/llite/vvp_object.c index 50a1a0b..0c40814 100644 --- a/fs/lustre/llite/vvp_object.c +++ b/fs/lustre/llite/vvp_object.c @@ -146,7 +146,7 @@ static int vvp_conf_set(const struct lu_env *env, struct cl_object *obj, * a price themselves. */ unmap_mapping_range(conf->coc_inode->i_mapping, - 0, OBD_OBJECT_EOF, 1); + 0, OBD_OBJECT_EOF, 0); pcc_layout_invalidate(conf->coc_inode); }