Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3693248ybh; Tue, 17 Mar 2020 04:58:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsjcIae7mFUdo9xKXdN4xdh7kp8xXQWI7jprnCqCYGAWKQYllPNAEcUFXT3oN2F12qgiGPC X-Received: by 2002:a9d:7607:: with SMTP id k7mr3252169otl.205.1584446321845; Tue, 17 Mar 2020 04:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584446321; cv=none; d=google.com; s=arc-20160816; b=dVkdRoQ8/9j2khe9jg8j7FFLhvQvCRN4OPqzMgsQBuGb1lrngUCCcis8GJqC1YMTBk CUfWV7bTmEuGAI6e/eViecaQxK89KNPYZcHybywfSRaO21FIgY4qmrpnyTZpFZi3ZqpB Vf+LotosxdK1+G9CZUvszVfSC4zx/dzLPC+IpBMIDC8x/y3n5wh9mdz2xrlGV/ER52Bg Uo+cEvhHyrzGlBOJRGhSOeS7y77cipjL8vMhznxQQLpHwUzWMz0DrHK8thIKnjBktFTY rxQkNQ90c+VfBDCENkwqKNoPSimQc4J1CGhw0N5jQVqilfPpCGeCyX0Xj4AVh0WRa4Qa dyBw== 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=6tLG0UvowYMxwNr6UXAFjrYE3UP2cWO9OOJLVI6SNuM=; b=ivwai1yxlEq9hu1BNIz43N8Bl++/pFQQqn84E6QVvMMz2ncLo6BzFzJmvjRozAAKPB XH1NXUiWf14dziQyaxZloZvg3rVCzbUT/9t/O3z4iN1cq8iLVxPCZhLBIuD5l8IwGr+S rKk4LviyeLvRSDkFaxrsdw/jSyeymUBFaMSpZXxwxTvTRh3jqNcVqzPDTo2/FNk0l+7V LRho5ICgQkaWaCk3bg6GSMAL1StNCP1rME6p1krb2RV6+eRSRALQT2ND7dbgLm3S2EDN 7ajZbejJ4dT10tyVxOJU+SaIlsnxI/kqKA5oElui/OC2Am5NZSY5BYoXI93eooiwQpTQ N0hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mdv9Ev0h; 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 f136si1802825oig.9.2020.03.17.04.58.29; Tue, 17 Mar 2020 04:58:41 -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=Mdv9Ev0h; 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 S1726066AbgCQL6W (ORCPT + 99 others); Tue, 17 Mar 2020 07:58:22 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:42402 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgCQL6V (ORCPT ); Tue, 17 Mar 2020 07:58:21 -0400 Received: by mail-oi1-f195.google.com with SMTP id 13so12462654oiy.9 for ; Tue, 17 Mar 2020 04:58:21 -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=6tLG0UvowYMxwNr6UXAFjrYE3UP2cWO9OOJLVI6SNuM=; b=Mdv9Ev0hWdBHO5UtWJBB5vCi54nNKxRYMIn7zCsdg1tggsr/dFr1x5TNXD+4ERd0q2 PUoF44Wb4BkSNPkR9ulesNTcwjCkGsbALj4ZupRv8XsmzqWwS5YJXopOOx8syMeK4533 7eJYFQUad/uIAzsDKrZnKv5hZtUuKt17hNXGdkfIJoDgY97TICZViYb6603+aR6OzAIb 2WSTWc2I0/1ENQjAE2ngPZCWMxZ8qIWEyPqceeV2NDusE76aX2/SupifuU1JiiZ96QMT fuESbGTlTjfcLIhal4/lii+GTNk+pVzllv8CdXvcxNo+Wm9dlKrXPl602p7K7WcrqKHS 8gcg== 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=6tLG0UvowYMxwNr6UXAFjrYE3UP2cWO9OOJLVI6SNuM=; b=bPjKCFAj2yCrY85s7/itq7Eh8Nat4UBMNa2vtiwbf9HMiUDbIKZDagCnHokY/1lSpc 7tUK8lcmTR884AJJFLxHAcH8OJ6yyKrSYiikvcgXhcMDZ3+6M00YWgTYaPkwv2MH1m6U YqGQrMfeCmD56REVdTN6srH5KjpL/XLBM7xHnoLugrFEEaWX3TjqijevAsuFAnkyi3n+ NVVj6ESq4Mh/FpdbaKlr6Ywzoq5pWjevNNQee01+UiLQiNznS3pvCNnRc8UOvE5NmTt/ zh6q2BBBx8CAeudFWJWQDXa55lEilvsfLfR3UZh/myvjnqOIBiIcTdJThX4s7kHScWWI Jpxw== X-Gm-Message-State: ANhLgQ1O2PIaRb8jH7YA6RwEk7l6xeAQlqJ3vqu1vT1zlXy904NlAPFV eAU4d18y/J+7hoJF0CFtvqHxs9txgAcSyFkH/waqdA== X-Received: by 2002:aca:c695:: with SMTP id w143mr3238753oif.98.1584446301315; Tue, 17 Mar 2020 04:58:21 -0700 (PDT) MIME-Version: 1.0 References: <20200317113153.7945-1-linus.walleij@linaro.org> In-Reply-To: <20200317113153.7945-1-linus.walleij@linaro.org> From: Peter Maydell Date: Tue, 17 Mar 2020 11:58:09 +0000 Message-ID: Subject: Re: [PATCH] ext4: Give 32bit personalities 32bit hashes To: Linus Walleij Cc: "Theodore Ts'o" , Andreas Dilger , Ext4 Developers List , linux-fsdevel , Linux API , QEMU Developers , Florian Weimer , Andy Lutomirski , stable@vger.kernel.org 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 Tue, 17 Mar 2020 at 11:31, Linus Walleij wrote: > > It was brought to my attention that this bug from 2018 was > still unresolved: 32 bit emulators like QEMU were given > 64 bit hashes when running 32 bit emulation on 64 bit systems. > > The personality(2) system call supports to let processes > indicate that they are 32 bit Linux to the kernel. This > was suggested by Teo in the original thread, so I just wired > it up and it solves the problem. Thanks for having a look at this. I'm not sure this is what QEMU needs, though. When QEMU runs, it is not a 32-bit process, it's a 64-bit process. Some of the syscalls it makes are on behalf of the guest and would need 32-bit semantics (including this one of wanting 32-bit hash sizes in directory reads). But some syscalls it makes for itself (either directly, or via libraries it's linked against including glibc and glib) -- those would still want the usual 64-bit semantics, I would have thought. > Programs that need the 32 bit hash only need to issue the > personality(PER_LINUX32) call and things start working. 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. thanks -- PMM