From patchwork Sat Aug 29 09:50:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 11744317 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 7A11613B6 for ; Sat, 29 Aug 2020 09:52:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F8E520936 for ; Sat, 29 Aug 2020 09:52:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="D0xMOiZC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F8E520936 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mykernel.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 524AD6B0003; Sat, 29 Aug 2020 05:51:59 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4AD866B0005; Sat, 29 Aug 2020 05:51:59 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3752E6B0006; Sat, 29 Aug 2020 05:51:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 1E7DE6B0003 for ; Sat, 29 Aug 2020 05:51:59 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D54C3180AD807 for ; Sat, 29 Aug 2020 09:51:58 +0000 (UTC) X-FDA: 77203139916.12.hot65_2b136f52707d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id AAC4C1800EB26 for ; Sat, 29 Aug 2020 09:51:58 +0000 (UTC) X-Spam-Summary: 1,0,0,bb8b17493617138c,d41d8cd98f00b204,cgxu519@mykernel.net,,RULES_HIT:41:355:379:541:988:989:1260:1277:1311:1313:1314:1345:1437:1513:1515:1516:1518:1521:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3622:3866:3867:3868:3870:3871:3874:4605:5007:6120:6261:6653:10004:10400:11026:11658:11914:12043:12291:12296:12297:12679:12683:12895:13069:13311:13357:14096:14097:21080:21444:21451:21627:30054,0,RBL:163.53.93.243:@mykernel.net:.lbl8.mailshell.net-64.201.201.201 62.14.2.100;04y838f3s1schayazxbqukuh9yy1nyp3kikwwufc6ie7n9bi61ry9de6dgkwuqd.53e85be4chswo7iif1r1g4s1fncwuthokkuoy3owqzow1g78jfdr5nxpdpncifc.k-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:261,LUA_SUMMARY:none X-HE-Tag: hot65_2b136f52707d X-Filterd-Recvd-Size: 3176 Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Sat, 29 Aug 2020 09:51:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1598694686; cv=none; d=zoho.com.cn; s=zohoarc; b=If0As52fb25P6rlWhPCodjf1Av7iwB0m0zxiaeQANQkvBEBn4giVeky3gfL2lS531GkMQrF3Lsl8IgVTGrAGBysZhEcASu/KD1wbXmXakrqXl0+CGhHQxtoAepJpvLh6JP3i1FgsmgUXuT8reh8VoESeN2YnpKhgpV5tuL52RsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1598694686; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=tX3B1l15hO/83TfyRX4DcvD2+Bkx6ul/guU7N9R9v20=; b=cn5VK5fqCkHvJkzRGC9oxGx3KtVS6y7UIvoy4Go5iwfoLp85tTWQ6LP5yhUbp5lfCi3D5QLPDu6G4zZuxEtwYkAdtB/mxNhqZdhWXu/uz9IC5D6H8HA6r91C0ylH/FoxEMOi2r3zKWEe0PUST70WyZZwuXDNSEHTpM9jPxPPgjA= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1598694686; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=tX3B1l15hO/83TfyRX4DcvD2+Bkx6ul/guU7N9R9v20=; b=D0xMOiZCEQ5QLo9vnsW5fSlWlBv18sFoH3Fz4TrAI/VgcJbposK9VXLQa5AaZ+b4 gPo+H3PDgKliuZHOm5GS9dqOjD1mTHKcx8FoPYvzsz1hcf6coi1D6stFj6KfpXM5Zw5 9cDOTgzrP1jRaluONAWX498ZaMEm/tUGyTkbC2Xs= Received: from localhost.localdomain (116.30.194.36 [116.30.194.36]) by mx.zoho.com.cn with SMTPS id 1598694683536758.9096728812141; Sat, 29 Aug 2020 17:51:23 +0800 (CST) From: Chengguang Xu To: linux-unionfs@vger.kernel.org, linux-mm@kvack.org Cc: miklos@szeredi.hu, akpm@linux-foundation.org, amir73il@gmail.com, riteshh@linux.ibm.com, Chengguang Xu Message-ID: <20200829095101.25350-1-cgxu519@mykernel.net> Subject: [RFC PATCH 0/3] ovl: stacked mmap for shared map Date: Sat, 29 Aug 2020 17:50:58 +0800 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-ZohoCNMailClient: External X-Rspamd-Queue-Id: AAC4C1800EB26 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Currently, there is still ro/rw inconsistency related to shared mmap in overlayfs, this patch set implements stacked mmap for shared map and transfer necessary operations to upper inode, so that we can keep data consistency in any kind of mmap. Patch 1 exports necessary functions from kernel to module. Patch 2 introduces struct ovl_file_entry to store real vm_ops. Patch 3 implements stacked mmap for shared map to keep data consistency. Chengguang Xu (3): mm: mmap: export necessary functions for overlayfs' mmap ovl: introduce struct ovl_file_entry ovl: implement stacked mmap for shared map fs/overlayfs/file.c | 178 ++++++++++++++++++++++++++++++++++++++++---- include/linux/mm.h | 2 + mm/filemap.c | 28 +++++++ mm/internal.h | 22 ------ 4 files changed, 195 insertions(+), 35 deletions(-)