Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1985738imm; Thu, 12 Jul 2018 11:04:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdRsWW2AiYVv7UrN2NI6Yrrplv58yXhqgFg79LDENRdMsaeDIsd223E8Kx28yU8z2jhVc/z X-Received: by 2002:a17:902:5481:: with SMTP id e1-v6mr3155395pli.7.1531418681953; Thu, 12 Jul 2018 11:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531418681; cv=none; d=google.com; s=arc-20160816; b=E4xuukFWbgj+wrjp2FuNrxqt4F8gulTak0l5EdIB9Qds1rr4kf26obuFOLKIvCEiM5 Q0MuRMua771dp3TjBdvbdxorihQiDm69Ysa1k0fJuz6I1cQCJtmkiWJEtfjdAkd+bz9j I4s6UHqNilCq3B1xq0I8m8LRZu52ewE2Z8vXNFvGMOZhj5Z64Hk0pkgelrUWv+IgIe3I aCrj3ypMM5GxOw6d7Qtoby4etQ7h5clb/TIxPj7UXGuwXzb9cUaYk7gxgQMgW0acoCln jvdR1rod66cp4iHgzyZLVBMRpGGy/HUQRc/By/bRA4t7unfBtsgeVu3Cvn3zvwjil0K9 UKZA== 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=M9v3Y81TJpkySoSKtAMzR8V2gq4pGpAv2kRnYGe1Wps=; b=WcgmyH09aXH1ROcXWKU5HwHHzRoXVZmpKImRJgHb2Y0xCGq1iU1qfhO4uyjzhUpVQQ 1wZij9j+oijWGIOfecx2irv6cwjeoL6o2v/IWP4edWU081cg6t1bEIiZ6fJxA7VAkNZd suBrYzalhJKM4Doxz/H+O4aScdjak6TylwRgaX5ljwhi0J+cMt6OliIhwPc8lSfbdC0/ BZRSeYE4W1vQbvlMW4ep2YW7U92f+rkOmc+lf2udAT5DVAIj+45snK8q5SH+FU0cMom/ BxR6TuQWNi/Gernds2hkVQNt/icxMWFeIbYY+LC7Yccjw9Ko+DRGYAuPzXW8AUlfJJNR dQcA== 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 l184-v6si21581399pge.257.2018.07.12.11.04.26; Thu, 12 Jul 2018 11:04: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 S1727037AbeGLSNq (ORCPT + 99 others); Thu, 12 Jul 2018 14:13:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41314 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725967AbeGLSNq (ORCPT ); Thu, 12 Jul 2018 14:13:46 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1C0B6CDA; Thu, 12 Jul 2018 18:03:06 +0000 (UTC) Date: Thu, 12 Jul 2018 20:03:04 +0200 From: Greg KH To: Al Viro Cc: David Howells , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 24/32] vfs: syscall: Add fsopen() to prepare for superblock creation [ver #9] Message-ID: <20180712180304.GA27758@kroah.com> References: <153126248868.14533.9751473662727327569.stgit@warthog.procyon.org.uk> <153126264966.14533.3388004240803696769.stgit@warthog.procyon.org.uk> <20180712171505.GA23780@kroah.com> <20180712172024.GZ30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712172024.GZ30522@ZenIV.linux.org.uk> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 12, 2018 at 06:20:24PM +0100, Al Viro wrote: > On Thu, Jul 12, 2018 at 07:15:05PM +0200, Greg KH wrote: > > On Tue, Jul 10, 2018 at 11:44:09PM +0100, David Howells wrote: > > > Provide an fsopen() system call that starts the process of preparing to > > > create a superblock that will then be mountable, using an fd as a context > > > handle. fsopen() is given the name of the filesystem that will be used: > > > > > > int mfd = fsopen(const char *fsname, unsigned int flags); > > > > > > where flags can be 0 or FSOPEN_CLOEXEC. > > > > > > For example: > > > > > > sfd = fsopen("ext4", FSOPEN_CLOEXEC); > > > write(sfd, "s /dev/sdb1"); // note I'm ignoring write's length arg > > > write(sfd, "o noatime"); > > > write(sfd, "o acl"); > > > write(sfd, "o user_attr"); > > > write(sfd, "o iversion"); > > > write(sfd, "o "); > > > write(sfd, "r /my/container"); // root inside the fs > > > write(sfd, "x create"); // create the superblock > > > > Ugh, creating configfs again in a syscall form? I know people love > > file descriptors, but can't you do this with a configfs entry instead if > > you really want to do this type of thing from userspace in this type of > > "style"? > > > > Why reinvent the wheel again? > > The damn thing REALLY, REALLY depends upon the fs type. How would > you map it on configfs? /sys/kernel/config/fs/ext4/ would work, right? Each fs "type" would be listed there. Anyway, the whole "write a bunch of options and then do a 'create'" is exactly the way configfs works. Why not use that? thanks, greg k-h