Received: by 10.192.165.148 with SMTP id m20csp2272024imm; Thu, 26 Apr 2018 08:23:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx49wVgRuBcj6S/ldYLGoqvEPwGVFXpcjpNnDRO0QP8d3erefquseGEBctHtuGxRKnphwefW2 X-Received: by 2002:a17:902:848e:: with SMTP id c14-v6mr33902331plo.95.1524756180120; Thu, 26 Apr 2018 08:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524756180; cv=none; d=google.com; s=arc-20160816; b=YGR1jsmeNrUftcKwy7Thkl0j2a9sWh4Yeyo5ZFkBgGC3S4dqB/aBvdl+9hPraqCgX8 AC5uKwW19tY2YsvgLvP/IgjMiJAyZcvC/7cVJi7sKjUDIxM8IfjNgSIrh6fgZWy25BN5 N3TMOtCCCczS8hHE2rRyirxXz8PU1kUmAc8b/7cjyUgT4aSm5j4zByRa1cx8STyz8ln7 kC/jeaTlxJb3I4dIInD1NK3GDKxexA+VoCRUuJX3yNC+oDtI/BNVAbj3Jf2fIR0SnHRF 9rZyMYJfKOL4kCS0cYdVjOJZf2Fb5uLaZ3ttOO7vxz993hIgqGME9XHAjSJa/2nXqsMo WNOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=hJjzhusO6kL1Qj2XJvpdtBXQyt4snnkB9NBZ/WTGZ3k=; b=sGUQ6Zs4+DAdtIql7zRAOpRaVDBPOX9AaK8LQSz1xvMY01nHAGw35100XOFslMI7dt /0gTgOzWEagYTTz9zPjxV+Cm+ud9iqg04RZI/39hrKOKQTmM4dMV37FqQmP0rt9nIxr4 U1weAr5FrMKJv6i7nqwJ2ByfXYYxw7SXx2COrUf7+DF3wm+y4XvrG/hD82Ef4NEDecD7 +PsKodKgYxn5N3dkXZ1an1nhzRXX4vBAkzgOaXGstFO6G5Jf8VPX6j2ykPOY0F0wCehB ZYljI8mgoqLPPUNNvCfpHhn89VwLZXUDZh6OgmlLX7Trl2lA5INjvh5QPTUsTL8KQxE/ uPsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=BGBZMGej; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si6411646pgc.523.2018.04.26.08.22.45; Thu, 26 Apr 2018 08:23:00 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=BGBZMGej; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756654AbeDZPVn (ORCPT + 99 others); Thu, 26 Apr 2018 11:21:43 -0400 Received: from mail-ot0-f170.google.com ([74.125.82.170]:36311 "EHLO mail-ot0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756434AbeDZPVl (ORCPT ); Thu, 26 Apr 2018 11:21:41 -0400 Received: by mail-ot0-f170.google.com with SMTP id p2-v6so29833689otf.3 for ; Thu, 26 Apr 2018 08:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hJjzhusO6kL1Qj2XJvpdtBXQyt4snnkB9NBZ/WTGZ3k=; b=BGBZMGejtVcBuH5HVrbaUnEH6JaZrlhPMHFhZQIiZpZxmagv7gDWSX7d37jEj9Hckk R/eovyugaPG8wYuBcWFzS2QWWjMJ6iBPw9r3pYxO6g0are5Pk6rfoj0axzYE5UBFtOgT KH3xktVxXje8W+UlPSro3rnpTxumc5kA7XM2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hJjzhusO6kL1Qj2XJvpdtBXQyt4snnkB9NBZ/WTGZ3k=; b=O+3HmPuaODiWMzZE9YzUZZENo9W6A9G4ASQHd2MsM6zg5yVOTekc4kgq2jghQPaTni 0ivFN/YMIZ2cM7EZCRzPrYA6OgVRQSAlVhVVM6c6BeGTVrxGb9puUo7StvW6VO7dszpe vdeIadpm7l0o5jK2hDZ9OHqhdttu7xiPeaLly25bV/nn2wiLprUMLS3u008zTiwdr00+ fFsVKJ+txaD3elypVFSMTTMsZYFx0lNavY/kizEh/DECELZ5ynYO/rzsGh1tAYK1kPaH nShKZfZbRBOKRzHe2SCG/N2uIY3mVrEd7mUUK6WgrERcccQmL/co5NzbfvGQU83YrMmM TYBw== X-Gm-Message-State: ALQs6tAg1zF6lvGnKlXvn0kRfCwLMokgfNrgXKz5VTcRRbfc0VukbCwe 7DwxWPcZ9XzVsMDk2saBuOVJyDXbFQUoEFjRqBItXg== X-Received: by 2002:a9d:3534:: with SMTP id o49-v6mr1019430otc.368.1524756100711; Thu, 26 Apr 2018 08:21:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:5303:0:0:0:0:0 with HTTP; Thu, 26 Apr 2018 08:21:40 -0700 (PDT) X-Originating-IP: [176.63.54.97] In-Reply-To: <20180426151305.GC4308@redhat.com> References: <20180412150826.20988-1-mszeredi@redhat.com> <20180412150826.20988-10-mszeredi@redhat.com> <20180426141337.GA4308@redhat.com> <20180426145641.GB4308@redhat.com> <20180426151305.GC4308@redhat.com> From: Miklos Szeredi Date: Thu, 26 Apr 2018 17:21:40 +0200 Message-ID: Subject: Re: [RFC PATCH 09/35] ovl: stack file ops To: Vivek Goyal Cc: Miklos Szeredi , overlayfs , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 5:13 PM, Vivek Goyal wrote: > Aha, cool. thanks. While I am at it, let me just ask one more stupid > question. > > I am wondering while opening the underlying realfile, why do we pass > in the path/dentry of ovl layer (and not underlying real layer). > > realfile = path_open(&file->f_path, file->f_flags | O_NOATIME, > realinode, current_cred(), false); > > This forces us to do file_dentry() in ovl_open() later to map top level > dentry to underlying dentry. > > We know the realinode and should be figure out real dentry. Can't we > construct path from underlying dentry and mount point and use that > to open underlying real file. I am sure there is some reason for doing > this way, just trying to understand it. The logical thing would be to just use the real path (as returned by ovl_path_real()). The reason we don't do that is because mmap stores the real file in vma->vm_file and vm_file->f_path is used in various places (e.g. /proc/PID/maps). We could have a separate realfile for mmap, but that would be additional complexity and memory use, so I don't think it makes sense. Thanks, Miklos