Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp21681ybb; Thu, 19 Mar 2020 15:44:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtWuPVdI/5M8k/76Ag9AQ2VI8tVgVice6z3To/zTLIWZnc/7c+tkoilavdUAMbThvix2iUe X-Received: by 2002:a9d:6946:: with SMTP id p6mr4327645oto.224.1584657864826; Thu, 19 Mar 2020 15:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584657864; cv=none; d=google.com; s=arc-20160816; b=TStjhD/1UroUTJBrv4/rVS+aadEgrHjcqXObs4vR/oG79BROWLkpPHBNJCkc/3pQgF zZyrHRQvcmbUkzJODSyPVjbiXP7ark7hrX5xh4qIL56+lrluNc8fVtzS5OwF4Xu6v0P6 kx59MRbJVmOUlrO3mEW3d+MzW7Lua/lL6/mFoHfF3Y6SRQzaKXqCsMLyxfTXfEvAN2IX pyvXsOS103onDmUgokwwy5KcVv2mDOo6sB2DYkO4+4Q6O3VbznrnlWAefOLyndTmCjrY QLvjTgkdNwHP5UTDM4oW8HGpY5Qyr9xltfnlDlxDMV8AA64EJqOxxcZD8YG2zRr2e3Bl 4vIg== 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=WJ6MzhtWalH0hDBYxWzZFJvnUo/A0DOitGKj0UfdYo8=; b=wOpycsyLPOVyX4whUcBnM1eTC8+HQgfHo8Qg1Ca/2/PuSFkdg9nXaYEBBBShhBicWJ eQZwsxctpKcx/jLGMaqPiR4LHeSYKNEt+TU/CO2nNZkcDoPleMvMK+U/l2FYNWibiy8I aSJv8Em1hapJefynpQNKa26XRI4mBeUQyZGtT80rWP1ZDFUjgnpMl5VvjZhVhAoPRSk8 t6XwC8N2nIjLbzM0g64UG52Oc6LRQI51R+tCeymcvloR+zlsPhjBrplQuS01gQwDHDqq 1dF/YB6MdLhyx46VDDdYibO8dyYWPrRGjNnh7jtpPOln4wMwRM/NSSo9E7jTaS8YvQug 8ibA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XBqh7pWn; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c133si1769271oif.272.2020.03.19.15.44.01; Thu, 19 Mar 2020 15:44:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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=@linaro.org header.s=google header.b=XBqh7pWn; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726930AbgCSWXr (ORCPT + 99 others); Thu, 19 Mar 2020 18:23:47 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38757 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbgCSWXr (ORCPT ); Thu, 19 Mar 2020 18:23:47 -0400 Received: by mail-lj1-f196.google.com with SMTP id w1so4371430ljh.5 for ; Thu, 19 Mar 2020 15:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WJ6MzhtWalH0hDBYxWzZFJvnUo/A0DOitGKj0UfdYo8=; b=XBqh7pWnTmUlqQohZOg/HeJr0gQHAIeXOwQCGzJ5OwLz0JntySiWzUQk/bbyBsqGm9 AOagPLaBdiW1PMwWYNG62+YPygcjxUIjKZCSAWI7Y+gXGQmEpDRx5s4L6A86L4QjzPhm g1WliO6jBKgCaK0bZjyFPxJo1T1kZceLM4t/lRH12iiIppbgjzQ3iyFeIrW4qK58Nko5 lbNS0FS7GU3iUIH68IUAikInyw3mSaCNwFQaUwVoTXF/SPEBXD79mERRqpVxClHgzlbO LuBZhWaZGVlUhSTRyD/NNbgZlWYzqDYTxbQym6CawlmhMV6GI3Nb15UmNwRMlI/s0Tib EF6w== 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=WJ6MzhtWalH0hDBYxWzZFJvnUo/A0DOitGKj0UfdYo8=; b=mzu0m5bRBy9KlrqLMmIMCFzZ8qJ2nWX9Dt0e3drBPOCtQTcSy4hGvK1UXv7dijayn9 +/zcHwgxSz4NGnahZRD3Qd4b+QGZoQ1e5tDeVBNA/nk6NL7Gj0zFhBTVyKcwG35WConz TrAZK7UGKh7YJzjnIUXYg73/hdORQx4TcdziYgPh53BFOU3hbjHRFhc9KLx1UsDhTVC1 HR6G4WxQ6CquEGllCsptTmWJl+VhOZgpk8wwynRGJ97E8q9S0CriOqcN474DLaSdwxjb E+9Y2g6cwmUeLyj1le0+wxrrfpvAI8YNy93cR7x62pQCrDzLSeVRl+Ud9NEvnx6NdsQY ACgA== X-Gm-Message-State: ANhLgQ3XAYW31Seu3wsDxyFHKxdP5j6wE53NM02jOWqAH46Frm2D5DBP 8bZGOmQW3Tkg5mgauo8z7wI/6oXvV2dmxqGN6ygAOQ== X-Received: by 2002:a05:651c:1026:: with SMTP id w6mr3408670ljm.168.1584656625715; Thu, 19 Mar 2020 15:23:45 -0700 (PDT) MIME-Version: 1.0 References: <20200317113153.7945-1-linus.walleij@linaro.org> In-Reply-To: From: Linus Walleij Date: Thu, 19 Mar 2020 23:23:33 +0100 Message-ID: Subject: Re: [PATCH] ext4: Give 32bit personalities 32bit hashes To: Peter Maydell Cc: "Suzuki K. Poulose" , "Theodore Ts'o" , Andreas Dilger , Ext4 Developers List , linux-fsdevel , Linux API , QEMU Developers , Florian Weimer , Andy Lutomirski , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Mar 19, 2020 at 4:25 PM Peter Maydell wrote: > On Thu, 19 Mar 2020 at 15:13, Linus Walleij wrote: > > On Tue, Mar 17, 2020 at 12:58 PM Peter Maydell wrote: > > > What in particular does this personality setting affect? > > > My copy of the personality(2) manpage just says: > > > > > > PER_LINUX32 (since Linux 2.2) > > > [To be documented.] > > > > > > which isn't very informative. > > > > It's not a POSIX thing (not part of the Single Unix Specification) > > so as with most Linux things it has some fuzzy semantics > > defined by the community... > > > > I usually just go to the source. > > If we're going to decide that this is the way to say > "give me 32-bit semantics" we need to actually document > that and define in at least broad terms what we mean > by it, so that when new things are added that might or > might not check against the setting there is a reference > defining whether they should or not, and so that > userspace knows what it's opting into by setting the flag. > The kernel loves undocumented APIs but userspace > consumers of them are not so enamoured :-) OK I guess we can at least take this opportunity to add some kerneldoc to the include file. > As a concrete example, should "give me 32-bit semantics > via PER_LINUX32" mean "mmap should always return addresses > within 4GB" ? That would seem like it would make sense -- Incidentally that thing in particular has its own personality flag (personalities are additive, it's a bit schizophrenic) so PER_LINUX_32BIT is defined as: PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, and that is specifically for limiting the address space to 32bit. There is also PER_LINUX32_3GB for a 3GB lowmem limit. Since the personality is kind of additive, if we want a flag *specifically* for indicating that we want 32bit hashes from the file system, there are bits left so we can provide that. Is this what we want to do? I just think we shouldn't decide on that lightly as we will be using up personality bug bits, but sometimes you have to use them. PER_LINUX32 as it stands means 32bit personality but very specifically does not include memory range limitations since that has its own flags. Yours, Linus Walleij