Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3312643pxa; Tue, 18 Aug 2020 11:53:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh7+ChOfQgxIVeoukT06POLXrt9eGT+xq+p2DnjrXa+tydKITZn/lQE+5+4Z7tQIdmktij X-Received: by 2002:aa7:c246:: with SMTP id y6mr21900018edo.78.1597776786861; Tue, 18 Aug 2020 11:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597776786; cv=none; d=google.com; s=arc-20160816; b=0UMEu6hhSdpfcPEs9tWTbAAYSdC8lSk2GWafr7u6PYt0aVkYuR4dMioBVNYaywKcr0 hzZYVR8Ss6bEpthvSJnkK6jlMmog/UpPSKAm0bRJvdV6PnChg7Xsh2MbPvz7urr+M8SH wiIRjyeq6YkUFfjDt3z4wo7XH5tZgfdefLX0sW9J5uCoSW3RmRw1XYslIqzquf2ZOkP+ SYMbtwCe6pNjuNKi9fI+kKezIbuv3yscUWCcQ+yv0b7leV0jyB/uH9dejBagP8m2c8i+ Kj1svL6CcMXIJMcW+Ai9c6ZAbk3pSmvkFZD7JrfrgclLz/m/kULX5ZyKOL7dKiykdGPQ PqEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U7uYPAcT0a2iCnawB895QmRQ5uyxHh+JN3tvANE4Kno=; b=qbuNLJ76a3aPZCWsHMEs+bQVosoB4yYel4oUq7JnN3ofilDkW3r/VduCreZUNjBITT FIacG23m0reNJJTjHh8hN0qU/IxhXhTdxdfQf66vpoMez+gU4E4HpMAYTpQtDYUv0mcu KVHvtIxJAhiy4J8Ev+bGzB03w0myyYQEJ7/9S+zxCNp7zN0sq1wF0XnuBd8iDPw0Ww6p ZBhwXxPzQaxD4D5UZfm81w/v/QNkd3LtODdHzw6nqARw/d+y+Lt/3XnOrNjVswUMyfVh dXdkKN2M3G/+/j7lzXtxLIBEl4+rGxVVoAjNmHzjFBRvbFbYaUoQ8hnYtcVCnMz0wou4 +V8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ofpfhktc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si13581236edq.412.2020.08.18.11.52.43; Tue, 18 Aug 2020 11:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ofpfhktc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgHRSvr (ORCPT + 99 others); Tue, 18 Aug 2020 14:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbgHRSvp (ORCPT ); Tue, 18 Aug 2020 14:51:45 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82610C061389 for ; Tue, 18 Aug 2020 11:51:44 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id c15so10780807lfi.3 for ; Tue, 18 Aug 2020 11:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U7uYPAcT0a2iCnawB895QmRQ5uyxHh+JN3tvANE4Kno=; b=OfpfhktcB0EPTZRtZL54l/zyIACV/6gX4M1jGmcmJz+vzsbzEUHkXqlwyyhXnVEw/b pb0mQNipDGcNuotJJcAm05QIjnugVLc3nSBHazWgWqbIC1R7nPjSnZAExUgdxpbrDVDF qQ/ANj0NRdAF1Kakd5EKBxqxVxEd2U/8zf13I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U7uYPAcT0a2iCnawB895QmRQ5uyxHh+JN3tvANE4Kno=; b=hOJaqNgjUaT2QVZTsmBJgddG6LAfgScam51jlBSiGBNtdNEKjiiwqJW3nF/lsrPn6v Nk61dfGw50VJr9fZSm0AZUuj/Sk22gYLyY1z7/Vg1UnZ9gBYHlxb77UGdlpO+R/EFX03 b16SmkJlUk58LCSQKMbg9LSOAoqROpDgQyYA+KsCEZnoSIFlXwUHIHt8zmYPp2ZHEqbr 6PyTQ0IvLjjANwhqYjxbRZF9J1Zk6RdB9IsKw1oaYK+4FMt8HLbkx7OjDXDU55GHsBTB vXa5RgZTN2aS4ij2cAd8R8bEbDa6rQfj+T40SYGL9RxFjbfKHqdIUd/BZurWAVUsc8Vm GzDg== X-Gm-Message-State: AOAM533TymvyI7ZSY7BHdpQ4of6/vu7AJdmwAZQPjEaWLMerKjEIbxdD YEbmlN0pQmW/NNM6SjIC2MVp2boZeYd7fA== X-Received: by 2002:a19:4094:: with SMTP id n142mr10371879lfa.166.1597776702601; Tue, 18 Aug 2020 11:51:42 -0700 (PDT) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id w19sm6096267ljd.112.2020.08.18.11.51.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2020 11:51:42 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id d2so10775315lfj.1 for ; Tue, 18 Aug 2020 11:51:42 -0700 (PDT) X-Received: by 2002:ac2:46d0:: with SMTP id p16mr10615970lfo.142.1597776701601; Tue, 18 Aug 2020 11:51:41 -0700 (PDT) MIME-Version: 1.0 References: <1842689.1596468469@warthog.procyon.org.uk> <1845353.1596469795@warthog.procyon.org.uk> <20200811135419.GA1263716@miu.piliscsaba.redhat.com> <52483.1597190733@warthog.procyon.org.uk> <066f9aaf-ee97-46db-022f-5d007f9e6edb@redhat.com> <94f907f0-996e-0456-db8a-7823e2ef3d3f@redhat.com> In-Reply-To: From: Linus Torvalds Date: Tue, 18 Aug 2020 11:51:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: file metadata via fs API To: Miklos Szeredi Cc: Steven Whitehouse , David Howells , linux-fsdevel , Al Viro , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , Ian Kent , LSM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 5:50 AM Miklos Szeredi wrote: > > How do you propose handling variable size attributes, like the list of > fs options? I really REALLY think those things should just be ASCII data. I think marshalling binary data is actively evil and wrong. It's great for well-specified wire protocols. It's great for internal communication in user space. It's *NOT* great for a kernel system call interface. One single simple binary structure? Sure. That's how system calls work. I'm not claiming that things like "stat()" are wrong because they take binary data. But marshalling random binary structures into some buffer? Let's avoid that. Particularly for these kinds of fairly free-form things like fs options. Those things *are* strings, most of them. Exactly because it needs a level of flexibility that binary data just doesn't have. So I'd suggest something that is very much like "statfsat()", which gets a buffer and a length, and returns an extended "struct statfs" *AND* just a string description at the end. And if you don't pass a sufficiently big buffer, it will not do some random "continuations". No state between system calls. It gets truncated, and you need to pass a bigger buffer, kind of like "snprintf()". I think people who have problems parsing plain ASCII text are just wrong. It's not that expensive. The thing that makes /proc/mounts expensive is not the individual lines - it's that there are a lot of them. Linus