Received: by 10.192.165.148 with SMTP id m20csp5068596imm; Tue, 1 May 2018 08:32:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq3C12BHgcJQXm9iGIroVA6qO6CkQHTMYxtSBFFnqlPENbhOHHij5HQlYk8I2fM6MyLh5Vw X-Received: by 2002:a65:65ce:: with SMTP id y14-v6mr13403349pgv.137.1525188767375; Tue, 01 May 2018 08:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525188767; cv=none; d=google.com; s=arc-20160816; b=Rumgdu2P95cNxsRhAOswcuEjrjJRGOfC4WJlkFehII8PUkthylicXdNxQknU8kdWjW 5/CkdaBrLtIj6HcZloXUSmOiFAK1WbPhfmY7dOYhfqQzAst4SmtpSnsjYxaHvYVGg3Og GYBKDROjChLlWC5b8f/BBNvg4m5kRK9SaPGqDbtx07bVPGS0JlQB7dL9x/auDZTudWmn IqVN2dDUGtHktjlXi2NZ/fDIWn7OLkez3O5jFQumqKNM5cZm99bpEzcmUgMueUcAGa44 3qZdv63C61nHh4cW2uZmQQYv2JDy5Z86qznbD38WYgqKguNZnWK803ALX+BNp06e2o8I mn5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Y/7pvfht8CVPOmikOtvRmOhsIaHnUrsbrmFQMcJh+SE=; b=B/enobPLTrOOrYCVZm3FSNKwXTbxN6NoSljYYthCksHqzaEocmd/NdsvR1O+Sfr4Ra Wa3+spC4WKffyDF3VcGqZveE4AxpJ40ef8xeYHYvaKFfZiYoeSTXDVZ8HuGqCKxen2OC 5JwRildlR38x3d16yNTvv+gFljOgk9b/MMb+E1L/VnvzOZKS3C13BjtQQ1nXOKF/N7dI l4uahhPURZ7/3bv6XRM/6LmVLS9sezt7oz9/5izOAXRKoZblE/AFDgJoQH2GMjhwHIJy xtgb9LydSN9+bvdfaJRW6ErgOigKeovpD6zh3Y5k/Jr1VmtHTk/V5cOgYgLitolWFuuh Pgyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JFErjLs3; 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 v29-v6si8434702pgo.483.2018.05.01.08.32.33; Tue, 01 May 2018 08:32:47 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JFErjLs3; 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 S1756096AbeEAPbN (ORCPT + 99 others); Tue, 1 May 2018 11:31:13 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:43410 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755434AbeEAPbM (ORCPT ); Tue, 1 May 2018 11:31:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y/7pvfht8CVPOmikOtvRmOhsIaHnUrsbrmFQMcJh+SE=; b=JFErjLs3Yc8VHCf0YlsNOEkXC dxJMn4YLyXgC92c9KswAflnYZFVk+ul+w+KMr+6WSUJ9SC/ed9kdbtPH0/A5QDIlZBMRafj1lJKBu f0VJrdFss7JYtPtxbLAsxb3CkiPiivq8HCkIYYL021dAU515B7VKihPpGDPSuVo5aHFLLIwU1PF2q EStU1mkCN3tTSsyP9w5pjUQD+NQMwUf0u//MDU5s3iGZWJeLJ0i0JbYc339K43Mz7BqQN8GxqzD/P O2Dq2bIaNJHuxwem9qzCBm7f9aEYAFQy5TTpWpaUChVvw2G3/gilcQTtxlcfCGDoc48X+l7h3pYD0 tUEgHg1QQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fDXF6-0007so-U0; Tue, 01 May 2018 15:31:01 +0000 Subject: Re: [PATCH 03/24] VFS: Introduce the structs and doc for a filesystem context [ver #7] To: David Howells Cc: viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org References: <05034a85-013b-30b6-ce17-4c95d4cab195@infradead.org> <152414466005.23902.12967974041384198114.stgit@warthog.procyon.org.uk> <152414468332.23902.3065751107691714414.stgit@warthog.procyon.org.uk> <8450.1525184950@warthog.procyon.org.uk> From: Randy Dunlap Message-ID: <96dacc1b-cffa-3aa2-71f5-70c8159c805e@infradead.org> Date: Tue, 1 May 2018 08:31:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <8450.1525184950@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/01/2018 07:29 AM, David Howells wrote: > Randy Dunlap wrote: > >>> + (2) Parse the options and attach them to the context. Options may be passed >>> + individually from userspace. >> >> Does this say that step (2) can be multiple small steps? > > Perhaps "phase (2)" would be a better name than "step (2)". During (2), > multiple argument-supplying calls may be made. Ack. >> How does step (2) know when userspace has completed sending individual >> options? > > Moving to phase (3) terminates phase (2). This is triggered by userspace > writing "x create" or "x reconfigure" to the fd as things stand. > >>> + (6) Return an error message attached to the context. >> >> where/how is this done? > > That got taken out and made general - which Linus then objected to. I need to > reinsert this and make it fscontext-specific as most people would really like > to have it, the mount process being able to produce so many weird and > wonderful errors. > >>> +When the VFS creates this, it allocates ->fs_context_size bytes (as specified >>> +by the file_system_type object) to hold both the fs_context struct and any >>> +extra data required by the filesystem. The fs_context struct is placed at the >>> +beginning of this space. Any extra space beyond that is for use by the >>> +filesystem. The filesystem should wrap the struct in its own, e.g.: >> >> in its own struct, e.g.: > > How about "... The filesystem should wrap the struct in one of its own, e.g."? OK. >>> + (*) int security_fs_context_parse_option(struct fs_context *fc, char *opt); >>> + >>> + Called for each mount option. The arguments are as for the >>> + ->parse_option() method. An active LSM may reject one with an error, pass >>> + one over and return 0 or consume one and return 1. If consumed, the >> >> What does "pass one over" mean? > > How about: > > An active LSM may return 0 to pass the option on to the filesystem, 1 > to cause the option to be discarded or an error to cause the option to > be rejected. Much better. Thanks. -- ~Randy