Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp52619imm; Thu, 12 Jul 2018 14:01:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/M0XlxbnOjh5wsUHNo+L0VN4XRMUa8n+dlZwgkmYvvcFYomx4cmS2BZCMwYqM9G4QF6u7 X-Received: by 2002:a17:902:123:: with SMTP id 32-v6mr3525385plb.181.1531429277883; Thu, 12 Jul 2018 14:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531429277; cv=none; d=google.com; s=arc-20160816; b=dp/XXeKyNKv3prTzs0qbXLQmkiMw9JrNAlr8WDB7Doxc/yHRpLDx109oNFjWfMqTAG EXyIfXnGkdKdUluSZDxJYaFITe6SNSH9jaUWQwCNW7oz3pN0Y5nEmibkt8Z5juyjrwm3 3i6YONegTnLAZTATAgA8kdtUL+gqtmuiD5doamwaeVh636Er2rgk4T98G0UtpjlqvQYl ngGC/o1cOSw7x2F/kPYdhMOjBazrhmTjeRChSf8vgC+v7Zk9xqZzQMP433nZxTPuBqca Ze/BIcHgkjZ4X0L0RFXesveLwUaZf8TENECF9pLRmxpK1n/BYXYZzA1wmkB+nVC6epIC 5fhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :mime-version:subject:cc:to:references:in-reply-to:from:organization :arc-authentication-results; bh=VBBJoBw7iWVwmPlwZdh5pyeFAOR2fzr0VP7wgdK1Pok=; b=AupoXgF4nZYKrrLY8Kr42t/5BP18QytRYB7OQnLFZXe8bAVUbuE6dKOumylIx50RFS gEK9wjmAz+gZDySsx3Gvti6k8EEJQe+X/TQk7+eDj4IzR85bBXjHMiTsVN3Zgb1nhEa0 HE4uy0ZYVljO9wXcq7989po9FcHoKbZL/QO3yWSeaq+sF46MJktb0qu6uCiOqoUIxQHo m+Qmr1HfW0kys9qmSWUSp7zkQ4BV+yBZ08sG+bgUAPH/gUeZaRdjAet3ip3e+fXre4Ri QnJSeU2QJJVm7MMWK7fwPkXDpCxdzI6pqYuPV2EDT407UWLqzNQbh9A/6LjRvCks1QyO phHg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b129-v6si3357794pfa.12.2018.07.12.14.01.02; Thu, 12 Jul 2018 14:01:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732805AbeGLVLj convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Jul 2018 17:11:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732341AbeGLVLj (ORCPT ); Thu, 12 Jul 2018 17:11:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05A3A9BB6A; Thu, 12 Jul 2018 21:00:20 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 991FE2026D6B; Thu, 12 Jul 2018 21:00:18 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <338BC3C4-F3E7-48F0-A82E-2C7295B6640E@amacapital.net> References: <338BC3C4-F3E7-48F0-A82E-2C7295B6640E@amacapital.net> <153126248868.14533.9751473662727327569.stgit@warthog.procyon.org.uk> <153126264966.14533.3388004240803696769.stgit@warthog.procyon.org.uk> <686E805C-81F3-43D0-A096-50C644C57EE3@amacapital.net> <22370.1531293761@warthog.procyon.org.uk> <7002.1531407244@warthog.procyon.org.uk> To: Andy Lutomirski Cc: dhowells@redhat.com, Andy Lutomirski , Al Viro , Linux API , Linux FS Devel , Linus Torvalds , LKML , Jann Horn , tycho@tycho.ws Subject: Re: [PATCH 24/32] vfs: syscall: Add fsopen() to prepare for superblock creation [ver #9] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Date: Thu, 12 Jul 2018 22:00:18 +0100 Message-ID: <17749.1531429218@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Jul 2018 21:00:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Jul 2018 21:00:20 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski wrote: > fsconfigure(contextfd, ADD_BLOCKDEV, dfd, path, flags); > > fsconfigure(contextfd, ADD_OPTION, 0, “foo=bar”, flags); That seems okayish. I'm not sure we need the flags, but I do want to allow for binary data in an option. So perhaps something like: int fsconfig(int fd, unsigned int type, const char *key, const void *val, size_t val_len); for example: fd = fsopen("ext4", FSOPEN_CLOEXEC); fsconfig(fd, fsconfig_blockdev, "dev.data", "/dev/sda1", ...); fsconfig(fd, fsconfig_blockdev, "dev.journal", "/dev/sda2", ...); fsconfig(fd, fsconfig_option, "user_xattr", NULL, ...); fsconfig(fd, fsconfig_option, "errors", "continue", ...); fsconfig(fd, fsconfig_option, "data", "journal", ...); fsconfig(fd, fsconfig_security, "selinux.context", "unconfined_u:..."); fsconfig(fd, fsconfig_create, NULL, NULL, 0); mfd = fsmount(fd, FSMOUNT_CLOEXEC, MS_NOEXEC); or: fd = fsopen("nfs", FSOPEN_CLOEXEC); fsconfig(fd, fsconfig_namespace, "user", "", ...); fsconfig(fd, fsconfig_namespace, "net", "", ...); fsconfig(fd, fsconfig_option, "server", "foo.com", ...); fsconfig(fd, fsconfig_option, "root", "/bar", ...); fsconfig(fd, fsconfig_option, "soft", NULL, ...); fsconfig(fd, fsconfig_option, "retry", "3", ...); fsconfig(fd, fsconfig_option, "wsize", "4096", ...); fsconfig(fd, fsconfig_uidmap, "dhowells", "1234", ...); fsconfig(fd, fsconfig_security, "selinux.context", "unconfined_u:..."); fsconfig(fd, fsconfig_create, NULL, NULL, 0); mfd = fsmount(fd, FSMOUNT_CLOEXEC, MS_NOEXEC); This does mean that userspace has to work harder, though, but it would simplify the LSM interface internally. Al Viro > First of all, block device *IS* a fucking option. Whilst that is true, I still need to be able to separate it out for unconverted filesystems. David