Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1054837imm; Thu, 31 May 2018 14:26:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJz+cEdglypwskcw5AxlfpUwHf4+RPESbXCuVrlX6BaZbhnROILT5fa9aCM9QV5MfbqZuGV X-Received: by 2002:a17:902:714e:: with SMTP id u14-v6mr1854872plm.289.1527802001892; Thu, 31 May 2018 14:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527802001; cv=none; d=google.com; s=arc-20160816; b=bc2bbL34QOpqnebEXUrs+UUHkQw8UhSKyqXpN7VR6aDSHmztY/CATEq4hnGpEAbSho JYssrZOazsvMGk+JqHOrENldqpaVaZxPT3kzl6UFSWktAMPc04eh5Ji4DKdXzWZpnJL8 KcmRxb56bkCPF1Cvx1nS6D9HisYWmUbNkZNFKa2NoBPYUAuGzmhLymbXwXiUxCiw+AVD ZRCpgDVpYfsotjh7h+ekz61UbXE4PDnjf8bWfJTJar7V6YbLOI+yGOqSFR6EkOMZB9Ug i92PxwSVO9D4t7tKk0d7Qz3nscoDwK4StfzpIFWOlTqU80AH5pcDGvY9QBTjaOKWcF3S 3Upw== 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=0RPLO69Kg45gsNSpRgpbo1qbDmBzaWzl4p+RWaBo6WI=; b=nle+lM4H0mwp2gk/uaOQ0eAO8MlqCeHHZr+6OIYgrSMTJYD8YNTwFt8iNXn1UUHQ6M Qs1U9p0eSO7frE14ZcBXLSIVeTAuv4H52VTY+b/zFdi+01KK9xiorYslTb/mBeq0OZPO 8AFlRDdJCm/NdxSd+MTqMNafVlC4Rses3pM/5M2pLVrBSrgD4h5uYzOBbhoeNFCxTJLO 18mOQ5cHSfCaKhpSlAoy5PXYe4LBEJUSMMdvCcKdqqCwJlqOSI/mKajGfuWLyqjyPvud VCl701OTPhdEWnUbKM4Da8fML6TbGv41KkMurbP8yFGcJ/vDNJ+3Sha+bOuV2+w9d/3a 8lTA== 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 s23-v6si14637073pfi.105.2018.05.31.14.26.27; Thu, 31 May 2018 14:26:41 -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 S1751337AbeEaV0D (ORCPT + 99 others); Thu, 31 May 2018 17:26:03 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51134 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbeEaV0B (ORCPT ); Thu, 31 May 2018 17:26:01 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fOV55-0008Vt-Oy; Thu, 31 May 2018 21:25:59 +0000 Date: Thu, 31 May 2018 22:25:59 +0100 From: Al Viro To: David Howells Cc: linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 19/32] VFS: Implement fsopen() to prepare for a mount [ver #8] Message-ID: <20180531212559.GK30522@ZenIV.linux.org.uk> References: <152720672288.9073.9868393448836301272.stgit@warthog.procyon.org.uk> <152720684753.9073.7743237635311367354.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152720684753.9073.7743237635311367354.stgit@warthog.procyon.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 Fri, May 25, 2018 at 01:07:27AM +0100, David Howells wrote: > + inode = alloc_anon_inode(fscontext_fs_mnt->mnt_sb); > + if (IS_ERR(inode)) > + return ERR_CAST(inode); > + inode->i_fop = &fscontext_fs_fops; That's almost certainly wrong - you need it only if you want it possible to reopen via /proc/*/fd/* > + fc->phase = FS_CONTEXT_CREATE_PARAMS; > + > + ret = -ENOMEM; > + path.dentry = d_alloc_pseudo(fscontext_fs_mnt->mnt_sb, &empty_name); > + if (!path.dentry) > + goto err_inode; > + path.mnt = mntget(fscontext_fs_mnt); > + > + d_instantiate(path.dentry, inode); > + > + f = alloc_file(&path, FMODE_READ | FMODE_WRITE, &fscontext_fs_fops); Re your question on IRC - we might want that fs in longer run, but for now just go with anon_inode_getfile() here. Easier that way and we can always switch later.