Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7903105imu; Fri, 28 Dec 2018 07:03:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/VBWpOTlz3bEArVwfHRIuVdDED3pGH0pirdZFlVsSCr3BTDAWWVPODbp5GoCURzkKbmxIm2 X-Received: by 2002:a62:2a4b:: with SMTP id q72mr28084675pfq.61.1546009413705; Fri, 28 Dec 2018 07:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546009413; cv=none; d=google.com; s=arc-20160816; b=ZF5bITkbrCQ19WG3lZvi9NmXk4DQ3s+H3fEWkxPF+NIlyuEPzKiFg80Z86YR+mjH3s EBHuaXW+cYihMotvJCNqagIpTa+Qum0uTE4oP4+1kAuC4EXMbXRmL5eRZjM0PULHpAL/ Y2u2AcciC73pxcmZjeiU+KlD2GYLaF/j4qTIYYMQmKigZRX/xPbxCAwRXDojUCti6Ozs 3XyrmscQqYToxEvZWnLkeCKwS20fW29qiPeEcTQls52ZtzpAEQMhp6HbycW48OKK4TQb XAxjwdM0QzEsi9DuTCjWTee027n876n4zj6CBARieHq0Yki9Q6821QjHLNoRZTR+1I5L P5gQ== 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=gcUDl6ISnsU1dssY6pxEXdhTuCvZosEd61/tc39dz8o=; b=xliXv8nG2Tw5mlnMDvJFkJRq4QUiT/BoDVg5UcAzneMIoFWIEUf71jEmPmqa2qko6d UbPdDCSyz36h2SCFgvahMTl90CnaQTJF6qQmZgj/KnwI3tnQLhH5XpKakAi5NyJswsjw R1qS0hmgdtr3RTE36W7Qe2HzuB62/aEhyzwTt9qm49Xoe5hmw2Ckd68lbnCYiK+XUxvj 7UW+nw9l9OMusYTYUJQ2vxwpyBlCCRFLm572csvudWQzmnU39Ri3QGC/AcBI/aMHg0nI F2+ZiTDSK2cQnxnWyWVfOs4zYJdgD6bUU/9rzfnDA46e/elDiuqp4E8ughL0/3h+jgjE MbNw== ARC-Authentication-Results: i=1; mx.google.com; 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 k62si2761800pfc.208.2018.12.28.07.02.48; Fri, 28 Dec 2018 07:03:33 -0800 (PST) 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; 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 S1727180AbeL1CXn (ORCPT + 99 others); Thu, 27 Dec 2018 21:23:43 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:35866 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbeL1CXm (ORCPT ); Thu, 27 Dec 2018 21:23:42 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 2701072CA65; Fri, 28 Dec 2018 05:23:39 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 1654A965691; Fri, 28 Dec 2018 05:23:39 +0300 (MSK) Date: Fri, 28 Dec 2018 05:23:39 +0300 From: "Dmitry V. Levin" To: Florian Weimer Cc: linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, libc-alpha@sourceware.org, qemu-devel@nongnu.org, ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net, hpa@zytor.com, arnd@arndb.de Subject: Re: d_off field in struct dirent and 32-on-64 emulation Message-ID: <20181228022338.GA27992@altlinux.org> References: <87bm56vqg4.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <87bm56vqg4.fsf@mid.deneb.enyo.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 27, 2018 at 06:18:19PM +0100, Florian Weimer wrote: > We have a bit of an interesting problem with respect to the d_off > field in struct dirent. >=20 > When running a 64-bit kernel on certain file systems, notably ext4, > this field uses the full 63 bits even for small directories (strace -v > output, wrapped here for readability): >=20 > getdents(3, [ > {d_ino=3D1494304, d_off=3D3901177228673045825, d_reclen=3D40, d_name=3D= "authorized_keys", d_type=3DDT_REG}, > {d_ino=3D1494277, d_off=3D7491915799041650922, d_reclen=3D24, d_name=3D= ".", d_type=3DDT_DIR}, > {d_ino=3D1314655, d_off=3D9223372036854775807, d_reclen=3D24, d_name=3D= "..", d_type=3DDT_DIR} > ], 32768) =3D 88 >=20 > When running in 32-bit compat mode, this value is somehow truncated to > 31 bits, for both the getdents and the getdents64 (!) system call (at > least on i386). Why getdents64 system call is affected by this truncation, isn't it a kernel bug that has to be fixed in the kernel instead? --=20 ldv --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJcJYkqAAoJEAVFT+BVnCUIcosQANvtFPNcdpTeqDv4BvJh1mmD tLkXHBOml79JQ42kYPcOV3iwQ4WJNkOdL9TzjrIGfEiwUVC8Kd6zJDt4SIeUGTlk JvKVizkgH7vtPL3dFwfBb4GSiBdRTK3+NP0MwbHjbIgHI0o9kmghqyElbMWdvhlO qUHuNcoAMI05qd0ZFJ31jHylo747iIQXmVha5CaK/4ntDYcx2/v+HFLzzgW7Ymm6 B14TgVRFDQGZtRjrAfp0cFFPiluXSfWwmLYUOnnqgGqxscj3uxkUIVdb4PSLEt3C BEfkBq9I9et6UVUh1Yunu9pYArOoZzYgJZOeoLm3QTijMKWeDJ5mqF33swjHGNQD 71ef9YTrWaZ0HnYgbiGTQCMskOSTgSMc7iugHNMdlba56QK/urmwiCP1Bc/4uiMO QrUziTdJc+pH7ZB4IG3n+3JK1LcSnlhv+i68BfvgJ5ZtN1v4xuLupe1K8JhLn0hT rDUJWdH+VQKSUZe4tKy1ElsvKF4yGrmwaILHE6fGwtY33XGUSKxGsidyWHZSVOms nk4P5w2hWrlQ0oCwqJ3d9uErV5Ih0UkxmRK9sNHmQXKw3cC3RjOSc33x8k6XAeAQ DIw4pRx94ePNbkavwVgr67DxGo3CmTcdlbfvFMf7J58DodxLZRBJENqeZAF4GTtN A091yYWKMqB/+28jrJD5 =C0vz -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--