Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5072132imm; Tue, 31 Jul 2018 05:09:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpddeUgLT1SX6NjTbuj/g7NwTAM09kd87pqoQ6RCBeiqPXNHmkvQP2nEwC+7N9RJaKhm6Rrr X-Received: by 2002:a17:902:9a06:: with SMTP id v6-v6mr7454199plp.316.1533038950556; Tue, 31 Jul 2018 05:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533038950; cv=none; d=google.com; s=arc-20160816; b=iYDf6tHbmMSmwokSGlNiQa3GzQcZFTVV6fScFpqmjsSGw5/j7+XsfYM3QrzFZfniSO pgax8PTVkCJUuIZNDJXepkqRyFtKF6UktfFa51XXJGJC+S9xesZqrD5S6esKG9Zrtz1B hpYmizp2vDSQ8YoBiq5VcNeKtIQa27NgNXSgzLg/8wQx55jNJ1J39H6IMKUbqzjHHHW+ ZcqdZO1RLbXr3KWyDc+6suQHi4Vf5s2qnfAswOa8AUZhqRnu227se8a9dwNDn+VU72Lc Lwaq/C2mW/SySx87yN7aZUJtBzCejMrMI+ZmyfUnM9xxsA71oe6xzFpYUfaD++7AJ6Dm hdLg== 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:dkim-signature :arc-authentication-results; bh=t+RXml8lvMCusowmNwZIGxbHQcNLPzIvdPKUb12CpNE=; b=Zqfza0O58IJtgwfd5r7kitr1mDbRcV9gzEKhJ7zpi4P5Sk7JMJKffsDadAjUhmGKSB PkyUgrGEFHxA4xQY8+R4xLCriW/Ujk4pX1/zG9on5U1H5IpDj8Kix0+Bu/y0EwHWQKCJ xh/4x9ur7Qrl9uSS1dMnZCxIoVD6TzNNFA4nLyFI9dIyaSpGxt9UKUO+PcIwNV9RTqtx 4XuxxBKBomcYZJcUmkiNhWZ/u7V8uS1Bk9ZJvKpD1wTAvJEPD+bz4RyANikxppIUZKAi U2MG8wccpbDl3wF9HrofjnbxTd+E/pWLlyd7llcNiY9kN/SSMT6FBD9D8h/0TsKE5ubK Ph4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m7XLxZS1; 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 a64-v6si14178185pfb.224.2018.07.31.05.08.55; Tue, 31 Jul 2018 05:09:10 -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=m7XLxZS1; 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 S1732065AbeGaNsC (ORCPT + 99 others); Tue, 31 Jul 2018 09:48:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47836 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729723AbeGaNsC (ORCPT ); Tue, 31 Jul 2018 09:48:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: 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=t+RXml8lvMCusowmNwZIGxbHQcNLPzIvdPKUb12CpNE=; b=m7XLxZS1c2ws/XKCRE8M8oAiZM W6DSTbwuIN8AjYs9T9MnnNisbNf6mnfQpz1LXyGEdoq01GqnoZ4zXRHkgmYG8AjIxplNalzL/YoMr FaEFArO0h3CziY7pNzzou4PHuYnBafSyi4sMy9EsK8EuJfoHmR7lUmj8lw3iB4Srv9tN88O8mZe8V TEwbyhaYzpQmYvWpQNVFrpxrzZ6YDiHClSlIke6Dt6fwScEMIa+rCy/ouY76KnBesJXqvF/4gyiSb uY2c0fCHb9cGY98N7VcugsFwe5ako3dfj6uqm6zODsnz1Xx5GODhTJs6OZjojbUQ0tDJiceX2Vnua vCjYyCqQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkTRQ-0003iL-S1; Tue, 31 Jul 2018 12:07:52 +0000 Date: Tue, 31 Jul 2018 05:07:52 -0700 From: Matthew Wilcox To: Pavel Machek Cc: David Howells , "Theodore Y. Ts'o" , 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: <20180731120752.GA23378@bombadil.infradead.org> References: <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> <20180731113422.GA22939@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180731113422.GA22939@amd> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 01:34:22PM +0200, Pavel Machek wrote: > On Tue 2018-07-31 11:11:53, David Howells wrote: > > Pavel Machek wrote: > > > Proposal is "message %s foo %s\0param 1\0param2\0", only strings > > > allowed. > > > > 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 limited > > 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. Then you haven't solved the translation problem at all; you've just made the in-kernel implementation harder. One example from the gettext docs: In Polish we use e.g. plik (file) this way: 1 plik 2,3,4 pliki 5-21 plik?w 22-24 pliki 25-31 plik?w Your proposal means that userspace needs to detect "%s file", determine if the corresponding string consists of ^[0-9]*$, then parse the string to figure out which of the plik* words is the correct one to use. In my preferred solution of just sending the damned english string, it's no more complex to regex match the string for "[0-9]* file", and choose the appropriate plik* translation.