Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4297748imm; Mon, 30 Jul 2018 12:00:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdxtVdawg74MR+2gyaCNzm/BZJHaHwIctdHRzuWsD+tu2Gm048jMJWil6TtZASm3TAZGXhv X-Received: by 2002:a62:1d49:: with SMTP id d70-v6mr14270881pfd.101.1532977240143; Mon, 30 Jul 2018 12:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532977240; cv=none; d=google.com; s=arc-20160816; b=lYe38S6v3UpbQbftQPy/WfdCUDXpBDyfA1GfzZSneSzbSXNjTLSOHA1x2eodtzTwws aEG23kIUXU/1hNYiAUbxF3cCu2fb8EyctFw7WCsne2dRLc5Hja/bQVEF00WZqqPnWaUi 2fYtisUMV44dmlxwIW37hd3PSyvZ2nq/CGt+P8ngfcsIvTH1iPQhE5+h6W9rRsyw85q8 e4BLqz+55+5BMlUD5kKODRqPRAuxZ1FlLJUhhzuvAMk90nMk/TmKezCh0ZcymMbAZLfR KEhWxSZ5o56x/sTOwiaW1RHXarNe1jGB+Cl9fk74P+qJYNYeZ3jqr4Y+CfTTBloPZMcM MY4A== 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 :arc-authentication-results; bh=k6J3utehhL+aPCm/q2Mqvjy+w5/MEVNYomLjhlX3GIg=; b=WdCuKyPcqfg6A+do6wbXvbjlDrsBIdx4wOfLvHZ/D0weLwqNd6zYcf1woV6vpfjaQV YxNIzibhQhiyw0S/utXsuGQHDM8UmxvD8twgTjzwj8ObKczULiRrOmJkazb0Bw9N2p3i iygsr/cj0mivnIOcpgugO0ZZTMLXHNC74eldWyEM7qwKhwv43hpM46qfZIM+JVmGdOXL QL7/PuKbd2+Kw0X70iZn0HRhmATs/K7bEuDIpI4ptX13f5XoFhG3+QaTtbUetfq94v+y B3WkKoMMmYWM3gAepKEPTaLd6INHl2VOSDqlhL3gqpzHwa2kgKZJgpPwFWlLH8FDqGlb YoPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=btVqLgMe; 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 v190-v6si11632941pgd.668.2018.07.30.12.00.25; Mon, 30 Jul 2018 12:00:40 -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=pass header.i=@linux-foundation.org header.s=google header.b=btVqLgMe; 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 S1731854AbeG3Ufq (ORCPT + 99 others); Mon, 30 Jul 2018 16:35:46 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:53124 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729542AbeG3Ufq (ORCPT ); Mon, 30 Jul 2018 16:35:46 -0400 Received: by mail-it0-f68.google.com with SMTP id d9-v6so766311itf.2; Mon, 30 Jul 2018 11:59:24 -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=k6J3utehhL+aPCm/q2Mqvjy+w5/MEVNYomLjhlX3GIg=; b=btVqLgMeifQt6l8FSL943zenwZTRpLK9LH6yt/XKlfTdcO4y56lvmb8Kx6RuqcrJ0o l+IhpTLoMx7L7YCNxOx8s7pGZ2Ltl8jPB6gnCkkjwAdyuLzlciVkugfzkT8cdbsaoEHL vPI7vWIo96V1B8svbnbNLfIQzd32BZSVknIkY= 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=k6J3utehhL+aPCm/q2Mqvjy+w5/MEVNYomLjhlX3GIg=; b=cvQlEiFUFRDxIj7lUZ/jMEx2iQkVJnNd/SMa47Mh1SMMMDCttuqXIsRrtIGr7w9MSb Mw5Nzyxb6NvLN+3ljpNVMQRIU8W7ci/FQburoaxSJD6ls37h2j+Q4EHjCGH17INQnIIw hFD5W7P+Xd+tZ45q//finxg0KWgTNR7b4f2ftg9WQJ7VF6d3fyuaXB6AHLj00XAHxq8c E0oLfZcOuezEYEyxwNN6nq6hAAvG65NAuAaTl2Yhug4DtodD6GHIavCIx9bcvVsoBURg hta+uX2ATZXsw/b2yE4PpNfN+eoGl9lHnf/uYoKMGF7QldH0OXtqy2sXXxuWAouVAA5c MPHw== X-Gm-Message-State: AOUpUlEisC3E+qYzJYhteQLXXtWvCwVAOCwbJIemdif7b9wfdL1JANzI coz1lqn0puvPtPr8uaZ5Ro/l25sldD7xMGSCkdQMt8MY X-Received: by 2002:a24:5002:: with SMTP id m2-v6mr494797itb.16.1532977164087; Mon, 30 Jul 2018 11:59:24 -0700 (PDT) MIME-Version: 1.0 References: <20180729113749.GA7333@amd> <153271267980.9458.7640156373438016898.stgit@warthog.procyon.org.uk> <153271292330.9458.14583488053811372222.stgit@warthog.procyon.org.uk> <25489.1532953411@warthog.procyon.org.uk> <20180730143104.GB24051@amd> <20180730180842.GA5544@bombadil.infradead.org> <20180730183847.GB5544@bombadil.infradead.org> In-Reply-To: <20180730183847.GB5544@bombadil.infradead.org> From: Linus Torvalds Date: Mon, 30 Jul 2018 11:59:13 -0700 Message-ID: Subject: Re: [PATCH 36/38] vfs: Add a sample program for the new mount API [ver #10] To: Matthew Wilcox Cc: Pavel Machek , David Howells , Al Viro , linux-fsdevel , 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 Mon, Jul 30, 2018 at 11:38 AM Matthew Wilcox wrote: > > I wasn't proposing putting gettext in the kernel. I was reacting to > Pavel saying "You can't return English strings from the kernel, you have > to translate numbers into any language's strings". The problem with gettext() is that if you *don't* have the strings marked for translated at the source, you're going to have a hard time with anything but the simplest fixed strings. When the kernel does something like mntinfo("Option %s can not take value %d", opt->name, opt->value); a gettext() interface inside the kernel (which really would be nasty) would have seen the format string and the values independently and would have generated the translation database from that. But once the string has been generated, it can now be thousands of different strings, and you can't just look them up from a table any more. Real examples from David's patch-series: errorf(fc, "%s: Lookup failure for '%s'", desc->name, param->key); errorf(fc, "%s: Non-blockdev passed to '%s'", desc->name, param->key); which means that by the time user space sees it, you can't just "look up the string". The string will have various random key names etc in it. But the alternative to pass things as format strings and raw data, and having all the rules for a "good gettext interface" are worse. It gets very ugly very quickly. So I really think the best option is "Ignore the problem". The system calls will still continue to report the basic error numbers (EINVAL etc), and the extended error strings will be just that: extended error strings. Ignore them if you can't understand them. That said, people have wanted these kinds of extended error descriptors forever, and the reason we haven't added them is that it generally is more pain than it is necessarily worth. I'm not actually at all convinced that has magically changed with the mount configuration thing. Linus