Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5035627imm; Tue, 31 Jul 2018 04:35:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeCLMzQ1njbWidHtaQUT8a/Qp7CzxbzjLIzagZZMJrDSPGfYmcHQePJ8kMVt6WivtOA36yp X-Received: by 2002:a17:902:1121:: with SMTP id d30-v6mr20449663pla.247.1533036934639; Tue, 31 Jul 2018 04:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533036934; cv=none; d=google.com; s=arc-20160816; b=0lBlUoVp+FST6y1UjpZxgS/qIqzSO9sUancuHxPUuavo5mhphY65GINU3GC2dLCkR5 N3INU71tTJd5F0mnh7KerbYVOb+O893YaDfInG/Oj4wVFUhzb1qWYLbEYWc/paMtlgwq TlvAnrcnPazhMYvoDN7Ffpzjq9BdT6T6x+Lwxu7BpbfMx9yvt+j3JRLEeRMuuD6ndNr5 30bVyP64qIUtHbRrhZgg5wSTpaaQTDjgFuDxJw/6np8gKVqdS9KK/juykiulP74mSjal CyKHRYwAMdByxUR6lu40eFq+m7aq71A5u8GifuUA2FeQKDaBG/yYgZPzxFjRJ13bZPJh qChw== 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=+8zd2hIUutVMoogRWP3bIRgTiiBO7j82w1xmJZU/ATc=; b=nJtKWeRd/2/BjPEKG8lBDZdX3Og/kuSwcFYplMlGCzegKrAxQjl2rjQIu1P2sDrKOg 7Q51+Ve1Usqa/kPrrcZBgqTa3gRKhq18FZK8GCh+NV2ItvaGsLpgcIlu0QbJ3nKllWyl hT+FXk7H0Fxue91Qweay+ajEmZHOGWiYdB5uL6QXgTyLgO/40Lyj/nQYEMVzazwXDHbV XMTHZy/PSlyQy1X8RB6DEWjqQHV8qJlqvOBC5oKDYnuFBFvyIbOxpngbpDLsrKrBt4xC twsu5iT0dHWwOdirC4XqPauR6QToEBdcUgO1Ku49bUs3IyEeG2DXeWLPtwWpQxZWyppL voSw== 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 y186-v6si13907188pgb.395.2018.07.31.04.35.20; Tue, 31 Jul 2018 04:35:34 -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 S1732048AbeGaNOT (ORCPT + 99 others); Tue, 31 Jul 2018 09:14:19 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:37446 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731895AbeGaNOT (ORCPT ); Tue, 31 Jul 2018 09:14:19 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 08DCE80694; Tue, 31 Jul 2018 13:34:23 +0200 (CEST) Date: Tue, 31 Jul 2018 13:34:22 +0200 From: Pavel Machek To: David Howells Cc: "Theodore Y. Ts'o" , Matthew Wilcox , Linus Torvalds , Al Viro , linux-fsdevel , Linux Kernel Mailing List Subject: Re: [PATCH 36/38] vfs: Add a sample program for the new mount API [ver #10] Message-ID: <20180731113422.GA22939@amd> References: <20180730143104.GB24051@amd> <20180730180842.GA5544@bombadil.infradead.org> <20180730183847.GB5544@bombadil.infradead.org> <20180730194938.GA12962@bombadil.infradead.org> <20180730210209.GY21725@thunk.org> <20180730235849.GA19692@bombadil.infradead.org> <20180731005802.GB21725@thunk.org> <18974.1533031913@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <18974.1533031913@warthog.procyon.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2018-07-31 11:11:53, David Howells wrote: > Pavel Machek wrote: >=20 > > Proposal is "message %s foo %s\0param 1\0param2\0", only strings > > allowed. >=20 > I think that's too strict and you will need to allow integer values, IP > addresses and possibly other things also. It could certainly have a limi= ted > set (e.g. no kernel pointers). I'd always use strings at kernel->user interface. Yes, we should support integers and IP addresses in kernel, but I'd convert them to strings before passing them to userspace. > You also haven't proposed what you think the internal interface should lo= ok > like. No, I did not. > and then the kernel has to render the whole lot into=20 >=20 > Another example, in ext4 we have: >=20 > printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d", >=20 > so we could do something like: >=20 > infof(fc, "EXT4-fs (%s): last error at time %u: %.*s:%d", ...); >=20 > on mount. But the use of "%.*s" is a pain for your interface. We can't = pass > qualifiers like "*" to userspace, so either the caller would have to copy= the > string first or the logging routines would have to edit the format string. > Though I suppose we could leave the editing to userspace. I guess internal interface can stay the same, at expense of complexity in infof function. It would data according to %blablax into string, then replace %blablax with %s. I guess we can keep infof function simpler by only allowing certain format specifiers... Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAltgST4ACgkQMOfwapXb+vIzUQCeKcj4yN5CrHq8n4t/qQ95ZXRr 7hgAn37+AHooUtvh4THq+lGOf2+uTxwt =9TuI -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--