Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2174396pxb; Mon, 12 Apr 2021 16:55:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy3/Ip0TZBsOecTyHPnHUsxcJ7NmBjyjGyiqEFeL4QWU6aX4mOf/F8G5LfIc33gj5WEV7N X-Received: by 2002:a05:6402:4314:: with SMTP id m20mr30952266edc.5.1618271754646; Mon, 12 Apr 2021 16:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618271754; cv=none; d=google.com; s=arc-20160816; b=psuxoWZgsQSeVqxVwbNZ903slVpQh8Fuzo4UmcGoMOwFvfcS4Sj2Mw3mi/5yKyTpYH EfgEnyg4PBDNUzJzmFVUkVJ11mDyvHVBzG6myigwlbcQ6VbLUQWaUo+AwVG8yCEA56f9 nUwJnkCUZK5RhRu6uM2DAkY1gn5s66xXDJoSuzRBuw1z9lBZEDYSbPjK1e2DjCmeM8SN RoydYCRZSmXaKQft2J0GtB0KhjPtluUCAWnjRIqTONqwJr67E2CU3Fd1qXmBVG0Nr0Qa EZKGTfU+7lfP+NCosQ+D5PD3G+EUNfJ0ED0++ElpFL24h6BIGEJO5vHCT2scT4XlTaSj QtAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=IMG7wCZHEYD7OzfTZpTCMRHTqmc2sT3TBFh8Si8+8QQ=; b=NgX3vIi78r7iRKc3KEoGoJsu/uFg6JZDWNu8qwxvSyumbXpDUs01uEXQHqa+We9jOj ANKRPdAeBFF4DlnthipIaoknsDL6qRnzZoyTNNzmFDqqrzJYU/9KMb9Jesm2XjbpeO97 p6rrQJWEdP31+DTRX/pVWjnReomkj+8NtXZwL/2fmUBqn23LICMGaaKDsDJEUvv0tPi6 G5u4Y+hmv59jIA82mlVyQkzP5t9dfHh04Gtc3L+ZOGh9Gd+YQ0u5X04buSeV+mfkcgh1 fa2h8HbBbs7Lh9mwrn46aEEaTdAMSmpWyCKOmEnDt77i6gJ9AS4SJBhXlEhk3dmhuJ6N dezQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si8175723edw.488.2021.04.12.16.55.31; Mon, 12 Apr 2021 16:55:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239481AbhDLKxt convert rfc822-to-8bit (ORCPT + 99 others); Mon, 12 Apr 2021 06:53:49 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:55176 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239655AbhDLKxr (ORCPT ); Mon, 12 Apr 2021 06:53:47 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-281-A9xhWcd5M3KabBODPhuZXA-1; Mon, 12 Apr 2021 11:53:26 +0100 X-MC-Unique: A9xhWcd5M3KabBODPhuZXA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 11:53:25 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.012; Mon, 12 Apr 2021 11:53:25 +0100 From: David Laight To: 'Christoph Hellwig' , 'Catalin Marinas' , 'Will Deacon' , "'Thomas Bogendoerfer'" , "'James E.J. Bottomley'" , 'Helge Deller' , 'Michael Ellerman' , 'Heiko Carstens' , 'Vasily Gorbik' , "'Christian Borntraeger'" , "'David S. Miller'" , "'x86@kernel.org'" , 'Arnd Bergmann' CC: "'linux-arch@vger.kernel.org'" , "'linux-s390@vger.kernel.org'" , "'linux-parisc@vger.kernel.org'" , "'linux-kernel@vger.kernel.org'" , "'linux-mips@vger.kernel.org'" , "'sparclinux@vger.kernel.org'" , "'linuxppc-dev@lists.ozlabs.org'" , "'linux-arm-kernel@lists.infradead.org'" Subject: RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition Thread-Topic: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition Thread-Index: AQHXL3nAXViKKuH90kqxIUkBtWSuL6qwmWXwgAATjVA= Date: Mon, 12 Apr 2021 10:53:24 +0000 Message-ID: <5c3635a2b44a496b88d665e8686d9436@AcuMS.aculab.com> References: <20210412085545.2595431-1-hch@lst.de> <20210412085545.2595431-6-hch@lst.de> <15be19af19174c7692dd795297884096@AcuMS.aculab.com> In-Reply-To: <15be19af19174c7692dd795297884096@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Laight > Sent: 12 April 2021 10:37 ... > I'm guessing that compat_pid_t is 16 bits? > So the native 32bit version has an unnamed 2 byte structure pad. > The 'packed' removes this pad from the compat structure. > > AFAICT (apart from mips) the __ARCH_COMPAT_FLOCK_PAD is just > adding an explicit pad for the implicit pad the compiler > would generate because compat_pid_t is 16 bits. I've just looked at the header. compat_pid_t is 32 bits. So Linux must have gained 32bit pids at some earlier time. (Historically Unix pids were 16 bit - even on 32bit systems.) Which makes the explicit pad in 'sparc' rather 'interesting'. Actually the tail pad can just be removed from the compat structures. Just a comment that mips and sparc have extra fields in the uapi header is enough. The kernel never needs to read/write the pad. userspace must provide the pad in case the kernel writes it. oh - compat_loff_t is only used in a couple of other places. neither care in any way about the alignment. (Provided get_user() doesn't fault on a 8n+4 aligned address.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)