Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042282imm; Thu, 12 Jul 2018 12:10:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflDoZBewqRoIoq83fUJjYPN8/7bjxxD+PxBgv07HXeUz7xNZPdKU7bdTi4SXDXhWr9dZfL X-Received: by 2002:a62:1c16:: with SMTP id c22-v6mr3704892pfc.148.1531422615698; Thu, 12 Jul 2018 12:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531422615; cv=none; d=google.com; s=arc-20160816; b=FBBRK3LfYILQb5BF7BUlSMrhRr40T95zObbNYMxt5FUPX0r8IdhCquSXZIVPQDCOQY BxHRWAoQo+BDxi16iPjqpDslkSxjs6EFThPmevAzgGZyC5bnWRXYIJ3etYOTs83HF8z+ jndTOq/sdx2GPGQ3STZc/CpDj8B6w+Dy5GwLTMNcBge3gcn5WFicov2M+8/PdnSjJZn2 WW1Z1Eajbblt8sIjcVBO1+1Vy8vW+7EK7Zqxmuh/wgJusBwPLw9Nz6oCEpYT2i36eD9E tL/GtucvMNLphAOENoRBINbSDIlim1TnPeGWp+JqbFex6wjq/B3VuHmymgtdx1oY5fsX zNOg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=nDwikSRmlTtuINx6ldUVrNuAcABBNSJBAHuj0KGqNJs=; b=BgM7+5hyk8YRpbDIc+x/+4aexiKEh5mbx+PnpI7tST4PR6MQqbXbDuDtupWkhy0y0/ 8HWFOQBxD2eEvdqymYnbr7cSF6XyZiB7/c0zR7TP39oQaOTjQNcMbLCZezoNB614VzIl NF10EvtMqj4at/gas2Pykpc6u+yp6eF2SWOECQCHOi9MuOoi6ouoEQRAlOkmM0uyWA9j 8aHB6R9k0YZR3yk9VD3z63in/zp1LOT8vtrEPTGWzm9fYIGSQiQKIO4lOBr9EN+iwCku OVPpl3WyTo2ta1lYVCGW9gp99oPIWpjkOirtO+PkwV/gUDYtgVjzluCTnvwe/gZzsI0g 2pdQ== 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 h14-v6si13126552pgg.540.2018.07.12.12.09.47; Thu, 12 Jul 2018 12:10:15 -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 S1728250AbeGLTTh (ORCPT + 99 others); Thu, 12 Jul 2018 15:19:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48638 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727082AbeGLTTh (ORCPT ); Thu, 12 Jul 2018 15:19:37 -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 0D60C2C; Thu, 12 Jul 2018 19:08:44 +0000 (UTC) Date: Thu, 12 Jul 2018 21:08:42 +0200 From: Greg KH To: Andy Lutomirski Cc: Al Viro , 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: <20180712190842.GA2000@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> <20180712180304.GA27758@kroah.com> <76211EBC-05ED-4FBA-A136-F5EEBFDD9FDF@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <76211EBC-05ED-4FBA-A136-F5EEBFDD9FDF@amacapital.net> 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 11:30:32AM -0700, Andy Lutomirski wrote: > > > On Jul 12, 2018, at 11:03 AM, Greg KH wrote: > > > >> 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? > > > > > > How do you mount configfs in the first place? And how do you use this > in a mount namespace without a private configfs instance or where you > don’t want configfs mounted?-- Ok, fair enough, I missed the part where this is going to replace mount(2). Although you could just use mount(2) to mount configfs on a mount point in the initramfs image and then go from there at boot time :) /me runs away...