Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5683664imm; Tue, 12 Jun 2018 11:32:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL9EFEnWatzmbtX0u9Asv3CZLhYDEghMMrSALYHyA6AcNfneWcVpriUu0rcOlvU9oITOBAH X-Received: by 2002:a63:84c6:: with SMTP id k189-v6mr1314919pgd.49.1528828326797; Tue, 12 Jun 2018 11:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528828326; cv=none; d=google.com; s=arc-20160816; b=n9M187kJcdO1I7R7Cyhk95nK1ad9WAELX+5MgLbGygAttq6+7T3TaZKUaWw9quIcJ9 GHndjn9En7kwNPhYLpcrZN/XQ5zKlAxBgoB8DGfh/3hZcyFeUkxl5kdq2hfWE1DMX11R 0N1GKcnk2ka9+pir75GjX3zLPai1c+u91OIi9+iZBJqUhw5llOvBr/k0ZR9zWWpbHeS3 IITEP/eS5O7wqiLBK0BaDD86LboTyzdvNbD3ctkkHy4rH5JIGAXJa0qfX0sk1Uhfji2b pUm9PNPf1N2SWa+BAQfpCsZZGKMU1kf9RVwPnwg/VJBTKtRq863rhLYKrszUWpk8v+Sn cxtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=bP9NCmt2DJt9hog9eMnf617KHCKZ4QoTrVIAk7/kCXI=; b=uGQRyKxFMiBCGjUOaEL6OkTEGUeZ/0P8LnGU14jfLlDg3Ep/1rBd9zvGfxRyVFygSW upDx9CPFsSwUwcrkwRVkYGH/B+pQW9D7wO0QYU1y7dVG5KAnz0DfrcjmfTUaa/+h/9qh +CEG4v/xk/9g55Aj3FQNm3FTIKm+o/5IXPBoht6tFZQ8IM7sD3kdTiR+cdcq54/Mplj0 4pTtLfBu23j4v0WldpTZDnRvWxssp/z5FDIIOPqqok0IRq4tmJEThRGDqkhGCcXxJBp/ MRjVJmzab+Uir5KAlaq8RGiSmPF6YXuwmcd4PrGz5xEeyDLxS8+tHX6fnYVmevImoUYq 8TmA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si589186pge.53.2018.06.12.11.31.50; Tue, 12 Jun 2018 11:32:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754110AbeFLSb0 (ORCPT + 99 others); Tue, 12 Jun 2018 14:31:26 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:35684 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753455AbeFLSbZ (ORCPT ); Tue, 12 Jun 2018 14:31:25 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fSo4h-0001W4-Gr; Tue, 12 Jun 2018 18:31:23 +0000 Date: Tue, 12 Jun 2018 19:31:23 +0100 From: Al Viro To: Miklos Szeredi Cc: Miklos Szeredi , overlayfs , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH 14/39] ovl: stack file ops Message-ID: <20180612183123.GB30522@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180612182423.GA30522@ZenIV.linux.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 07:24:23PM +0100, Al Viro wrote: > On Tue, Jun 12, 2018 at 11:24:39AM +0200, Miklos Szeredi wrote: > > > > Note that anything that uses file_dentry() anywhere near ->open(), > > > ->read_iter() or ->write_iter() is an instant trouble with your scheme. > > > Such as > > > int nfs_open(struct inode *inode, struct file *filp) > > > { > > > struct nfs_open_context *ctx; > > > > > > ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode, filp); > > > if (IS_ERR(ctx)) > > > return PTR_ERR(ctx); > > > nfs_file_set_open_context(filp, ctx); > > > put_nfs_open_context(ctx); > > > nfs_fscache_open_file(inode, filp); > > > return 0; > > > } > > > > > > You do want to support NFS for lower layers, right? > > > > There's no change regarding how file_dentry() works. We've just > > pushed these weird files (f_path points to overlay, f_inode points to > > underlay) down into the guts of overlayfs and are not directly > > referenced from the file table anymore. That shouldn't make *any* > > difference from the lower fs's pov. > > *owwww* > 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 ;-/ > > Fuck. OK, so we want to get rid of ->f_path.dentry accesses and see > that they don't come back. Leaving them around due to "it won't come > anywhere near overlayfs" was a mistake of the same kind as leaving > d_add() in ->lookup() instances where we'd been certain that filesystem > would never get exported over NFS. Just as we'd got open-by-handle for > e.g. NFS, we'd got nothing to prevent ecryptfs as lower layer in > overlayfs... > > I hate it, but... consider path_open() objections withdrawn for now. > 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... PS: conversion of ->f_path.dentry is easy and that can probably go this cycle - it's a fairly trivial change, with no functional changes unless overlayfs is used with , fixing really bad shit if it ever gets used thus. I'm not asking to put that into overlayfs pull *and* it's independent from the "want to kill that fucking kludge" stuff. The latter is too hard for this cycle, unfortunately.