Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp552098imm; Wed, 13 Jun 2018 04:57:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKkwHIpsXwvmIVDbtz+JlrFXcNTrgsqNfiJ4nyFJiEkRrnEgsOWvnoXKAsQM9YEvHQIEROb X-Received: by 2002:aa7:8004:: with SMTP id j4-v6mr4624026pfi.174.1528891067551; Wed, 13 Jun 2018 04:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528891067; cv=none; d=google.com; s=arc-20160816; b=CucQ2/o916WMH4PGY2ajYPXFJtMN2rMvY/AWPCXh0GoLDF6cGnVz7C5ofq7okkPLFS nQJs3osbmOxcx9dlOGcYQR9H8XZeVRTkcB4l/l8+Y9kE2JHDTa1ARcqU/86u3bbGknAl yPixAH+we5kE0MHPeClznQgAhKyr88wyCjSnpdEg/QxCKzloxSEdHAVVJKjSdsNlJ20G MTk1aKI8aopjans9Q2OH3Y2wzYd7CPk0srZaM6kNIb4baiGZyzNFmdDaRn5DG+c21nSX N6WGIM1x0aL4HclNf75OA8ERe33RxjZW+PRAnueOz1wZYHbVsxSBULYKhlLUgKKnahEJ sPzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:references:in-reply-to:cc :to:subject:from:arc-authentication-results; bh=ypKKleE1EISjLkJN4/MqaIbNILBPesKKcUaTuN6heWA=; b=sKv+rmH3YY07UcqmWqLpH0cxxSIu14DkB8mb/bYV4tcb+OcqBvjfxW5YLCegKjHN+O ZE9z7cZItxzHAvV/mJvuUFqEE0ZYgd8VHlADNwDBJs5dX2I70s1MyNuFtqDaPZvVm+mx uLy0ivglDUwPi1cCXGg80ZgEjCqlaorpmGbrnrpotiFGWcDIwofA0BJE1NgM5hXAQPol ZcA0PJ92fc0G6CKupAWZGx+jf6Q2g1FbJPesMOjYw3bVH+AjAGFjq3xwnihVGJsgWQYO YsGj/pKc+aaPyzgZv7v5eVgBBw3R/1yIYa5oR4rSpmSUCqOFIqZevQSihwI5c7q7Gva2 lGBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9-v6si2697021ple.104.2018.06.13.04.57.33; Wed, 13 Jun 2018 04:57:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935365AbeFML4O (ORCPT + 99 others); Wed, 13 Jun 2018 07:56:14 -0400 Received: from mail05-md.ns.itscom.net ([175.177.155.115]:57101 "EHLO mail05-md.ns.itscom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935261AbeFML4M (ORCPT ); Wed, 13 Jun 2018 07:56:12 -0400 Received: from scan12-mds.s.noc.itscom.net (scan12-md.ns.itscom.net [175.177.155.6]) by mail05-md-outgoing.ns.itscom.net (Postfix) with ESMTP id 74639658515; Wed, 13 Jun 2018 20:56:10 +0900 (JST) Received: from unknown (HELO mail04-md-outgoing.ns.itscom.net) ([175.177.155.114]) by scan12-mds.s.noc.itscom.net with ESMTP; 13 Jun 2018 20:56:10 +0900 Received: from jromail.nowhere (h116-0-242-084.catv02.itscom.jp [116.0.242.84]) by mail04-md-outgoing.ns.itscom.net (Postfix) with ESMTP; Wed, 13 Jun 2018 20:56:10 +0900 (JST) Received: from jro by jrobl id 1fT4Nm-0001NU-1n ; Wed, 13 Jun 2018 20:56:10 +0900 From: "J. R. Okajima" Subject: Re: [PATCH 14/39] ovl: stack file ops To: Al Viro Cc: Miklos Szeredi , Miklos Szeredi , overlayfs , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds In-Reply-To: <20180612182423.GA30522@ZenIV.linux.org.uk> References: <20180529144339.16538-1-mszeredi@redhat.com> <20180529144339.16538-15-mszeredi@redhat.com> <20180610041243.GJ30522@ZenIV.linux.org.uk> <20180612022926.GY30522@ZenIV.linux.org.uk> <20180612024029.GZ30522@ZenIV.linux.org.uk> <20180612182423.GA30522@ZenIV.linux.org.uk> Date: Wed, 13 Jun 2018 20:56:10 +0900 Message-ID: <5299.1528890970@jrobl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Al Viro: > I'd managed to push that particular nest of horrors out of mind ;-/ > Having dug out my notes from back then and grepped around... The real > mess is not even /proc/*/maps - it's /proc/*/map_files/* and yes, the > reasons for that kludge are still valid ;-/ ::: > Uses of ->vm_file (and rules for those) are too convoluted to untangle > at the moment. I still would love to get that straightened out, but > it's not this cycle fodder, more's the pity... I don't fully read this thread, but the discussion is related to the file path printed in /proc/$$/maps? If so, as just for your information, here is an approach that aufs took. In linux-v2.6 era, aufs tried implementing mmap by customzing address_space ops, but it was not good and failed completing the implementation. As wel as overlayfs, aufs has two struct file objects for a single a regular file. One is for a virtual aufs' entry, and the other is for a real layer's entry. When a user issues mmap(2) for the virtual file, aufs redirects the request to the real file on the layer internally. So the vm_file points to the real file. It means /proc/$$/maps prints the unexpected file path. Aufs added another struct file* vm_prfile in struct vma. It points to the virtual aufs file, and /proc/$$/maps prints vm_prfile instead of vm_file. Of cource, maintaining vm_prfile is important since vma may be merged or splitted. Still I don't like this approach, but I don't have another better idea, also it works for many years. You can get the patch in aufs4-standalone.git on sourceforge if you want. J. R. Okajima