Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3727279ybz; Mon, 20 Apr 2020 08:21:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJJ5kD43vsJDBeyyUJtQFCJCO7GW3TcemIc86otpsEVg0ROStfa3+itqiAJEbOJ75wIdVOh X-Received: by 2002:a50:f095:: with SMTP id v21mr14951755edl.103.1587396106524; Mon, 20 Apr 2020 08:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587396106; cv=none; d=google.com; s=arc-20160816; b=KEG5Qn/PtM/1b6MsBb/VfyM2Xchmpbf7Lzf2a08wntn/w/xrNRe7q0pnXYSAa1056V 0SFLvalbgOtm6y04wMvLNFLotAdqYm75B4/tG/LFxN5LB7XvGaFnZWZNGhS3CJNtVwKk wsUXBqkT9LbNUTrNQnXh92Qp+fNARfYubqj49GlDbqRLBK2N4utgGgsaSTzZoi5QHIbT 4RuwCJ2pWCjVq/rL/4Udb83dnDpY8wJmTVYvHyS+Fg7cBT2m1klfwG/IWmFgPNLVTcVG B9eTDizH2pg12BR/SPVIQ5NKcl/Q+p4IVkRQFG6RAfam8++LA8vaNhxFI07FCg0fiVqk QuCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LR7PWJj+3P3sE6bFSaa5V5DbQ9JiDwPd5y054mZDXb4=; b=m7szvtv2N0ilLDJejrVu1tCXHfFyjZrN+FxkldoU32uZWCm5iFstLR3oUWwi28yjb/ eKZGccK/Aebq2Nh/fE5ZEHMiVA44MOK2ion69GXXDPSdzvY9rqkNAXjzSz+xiPVrjdIr XJULSGpLLi/IAsHTUSxOuIEVODjVfXEnyIyb3wIryyWdaXnUlmqmdZErxVeo8gJUXNAs Sm3rnW1An1jv1Yf1WQfuE4MabLEnKTcUr+JJRStkiIQM9nFlZwct0S0Og2pQYujxYzeg xOMGNBaPBiPNd7iZd2vs0sPxVkf1ScmT9MpHnGOPvk/YvBfRrjtvKpL7exAcHPKrRczC Rx0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si698748ejm.361.2020.04.20.08.21.22; Mon, 20 Apr 2020 08:21:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728882AbgDTPOA (ORCPT + 99 others); Mon, 20 Apr 2020 11:14:00 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:60696 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727053AbgDTPOA (ORCPT ); Mon, 20 Apr 2020 11:14:00 -0400 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 03KFDigW013296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Apr 2020 11:13:46 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 6BF1342013B; Mon, 20 Apr 2020 11:13:44 -0400 (EDT) Date: Mon, 20 Apr 2020 11:13:44 -0400 From: "Theodore Y. Ts'o" To: Linus Walleij Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, qemu-devel@nongnu.org, Florian Weimer , Peter Maydell , Andy Lutomirski Subject: Re: [PATCH] fcntl: Add 32bit filesystem mode Message-ID: <20200420151344.GC1080594@mit.edu> References: <20200331133536.3328-1-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331133536.3328-1-linus.walleij@linaro.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Mar 31, 2020 at 03:35:36PM +0200, 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. > > This adds a fcntl() operation to set the underlying filesystem > into 32bit mode even if the file hanle was opened using 64bit > mode without the compat syscalls. s/hanle/handle/ The API that you've proposed as a way to set the 32-bit mode, but there is no way to clear the 32-bit mode, nor there is a way to get the current status mode. My suggestion is to add a flag bit for F_GETFD and F_SETFD (set and get file descriptor flags). Currently the only file descriptor flag is FD_CLOEXEC, so why not add a FD_32BIT_MODE bit? Cheers, - Ted