Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5244202rdb; Wed, 13 Dec 2023 03:21:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIpHvV7WUKPoD8PkKEIzagj64Vh3hJidk+im5ukKtdm/ZDtMRwFqovHncWVNEnc7r56i6F X-Received: by 2002:a17:902:ab83:b0:1d0:6ffd:e2f0 with SMTP id f3-20020a170902ab8300b001d06ffde2f0mr6952730plr.138.1702466463424; Wed, 13 Dec 2023 03:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702466463; cv=none; d=google.com; s=arc-20160816; b=d4HlYK4tn1YIU7DmhjQisM7J+yEnZDUxTtbK2muLrapIhN6RA10exaSEZSYAyoB5ZG Mea4J3qqbGhq5mKrVvForY8cBcpJ9jMBAO+LIKX+9gzR+SMHtYJnivM7/jSx/QtuGXzu S/Qvfc2yrfQ3Ca1UyXQKLTdNPLFL1wvfc3l9bIFI6f5GhTWghhkBrSP0L/B35Pt2LihO 9CtR8NQuppQz4cSlCHwAKIOEADyD+dgQ7v1s2y7vZa4Y7LqAJy6OtxjRWDxzKEjMg6E0 8dhzciyqDxW6el9enfUHrvh6R9yDwG6JHpTSvoh6Zyu2BbnpKIFEGK8/sgkJXOz7ZaSv P8kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=s+wcnESLYU9HhNaOkniwhzmqLjKQKrV+1x/FjwBd1I4=; fh=/H4Ork6UaLwyxux1pXqqjpKulThNjXPaKdIlOCK9ezQ=; b=gPa8Y75JU9f6j/t7oKPfBgcyfd3GtLVfLSZzcXCOA3ek91bebbgY1HfaCtjQoGMKAO fZx7nRBqzkhbNmfWQ2XNNx4pwAFX/EzpESUawLiFB89oNIUB4b4lK/nyIE2nWOMN2ZAo lu1WS9O0Uogqsn62F+4O7a22Yywch0ovmZzpO1Ua3cRmPdsCLWxYzz/4kiG1mnSn5kZ+ euljZr3trCY5dTlpP8kCwrnOY/QrfxjCq3mAUqJCAiJC7ClFplB6VYrmU8edjb/Xbf16 evyAYoskm4b/ODkmIL0HMQoJ9xvHgSRB8z9R9KN41u4c/qdy241cralEqX8ACSGgZ3Xf 4R6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PXiYiycN; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PXiYiycN; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h9-20020a170902b94900b001cfd754d79esi9534817pls.79.2023.12.13.03.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 03:21:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PXiYiycN; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PXiYiycN; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 37D6B80936DE; Wed, 13 Dec 2023 03:20:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377206AbjLMLUZ (ORCPT + 99 others); Wed, 13 Dec 2023 06:20:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231947AbjLMLUY (ORCPT ); Wed, 13 Dec 2023 06:20:24 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1E70B0; Wed, 13 Dec 2023 03:20:29 -0800 (PST) Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9DFE5222C4; Wed, 13 Dec 2023 11:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1702466427; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s+wcnESLYU9HhNaOkniwhzmqLjKQKrV+1x/FjwBd1I4=; b=PXiYiycNHBs4OBe/8nDEB8SJNvw8dJxOHmyPDJ+dgrJDqQe3apXh6PoK2dhEzhZ9P/CzO7 NQqnGoQr72zNGTU8D4188xC1POrWSjibqFraYWBm24yAEmEmhMHigi2hHm2oEJcVaq0uIK LEhT6UgyMgWKTbdIUTAifUZufNDcpsw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1702466427; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s+wcnESLYU9HhNaOkniwhzmqLjKQKrV+1x/FjwBd1I4=; b=zVCLyiGwwrEGhLMywzjUCP20OIfFB6vB5teuBSMV930b801bP9H4YV8IQ5GLGKwhu137+y uj8AibVXWRujGBDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1702466427; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s+wcnESLYU9HhNaOkniwhzmqLjKQKrV+1x/FjwBd1I4=; b=PXiYiycNHBs4OBe/8nDEB8SJNvw8dJxOHmyPDJ+dgrJDqQe3apXh6PoK2dhEzhZ9P/CzO7 NQqnGoQr72zNGTU8D4188xC1POrWSjibqFraYWBm24yAEmEmhMHigi2hHm2oEJcVaq0uIK LEhT6UgyMgWKTbdIUTAifUZufNDcpsw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1702466427; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s+wcnESLYU9HhNaOkniwhzmqLjKQKrV+1x/FjwBd1I4=; b=zVCLyiGwwrEGhLMywzjUCP20OIfFB6vB5teuBSMV930b801bP9H4YV8IQ5GLGKwhu137+y uj8AibVXWRujGBDg== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 82EE713240; Wed, 13 Dec 2023 11:20:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id j4LwH3uTeWXHBQAAn2gu4w (envelope-from ); Wed, 13 Dec 2023 11:20:27 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id EDAAFA07E0; Wed, 13 Dec 2023 12:20:26 +0100 (CET) Date: Wed, 13 Dec 2023 12:20:26 +0100 From: Jan Kara To: John Garry Cc: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jack@suse.cz, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-scsi@vger.kernel.org, ming.lei@redhat.com, jaswin@linux.ibm.com, bvanassche@acm.org Subject: Re: [PATCH v2 04/16] fs: Increase fmode_t size Message-ID: <20231213112026.kkfcwtg64kiadhn5@quack3> References: <20231212110844.19698-1-john.g.garry@oracle.com> <20231212110844.19698-5-john.g.garry@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212110844.19698-5-john.g.garry@oracle.com> X-Spam-Score: 8.24 X-Spamd-Bar: +++++ X-Rspamd-Queue-Id: 9DFE5222C4 Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=PXiYiycN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=zVCLyiGw; dmarc=none; spf=softfail (smtp-out1.suse.de: 2a07:de40:b281:104:10:150:64:98 is neither permitted nor denied by domain of jack@suse.cz) smtp.mailfrom=jack@suse.cz X-Spam-Score: 5.99 X-Spamd-Result: default: False [5.99 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(1.20)[suse.cz]; R_SPF_SOFTFAIL(4.60)[~all]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[23]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:dkim,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:98:from] X-Rspamd-Server: rspamd1 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 03:20:46 -0800 (PST) On Tue 12-12-23 11:08:32, John Garry wrote: > Currently all bits are being used in fmode_t. > > To allow for further expansion, increase from unsigned int to unsigned > long. > > Since the dma-buf driver prints the file->f_mode member, change the print > as necessary to deal with the larger size. > > Signed-off-by: John Garry Uh, Al has more experience with fmode_t changes so I'd defer final decision to him but to me this seems dangerous. Firstly, this breaks packing of struct file on 64-bit architectures and struct file is highly optimized for cache efficiency (see the comment before the struct definition). Secondly this will probably generate warnings on 32-bit architectures as there sizeof(unsigned long) == sizeof(unsigned int) and so your new flags won't fit anyway? Honza > --- > drivers/dma-buf/dma-buf.c | 2 +- > include/linux/types.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c > index 21916bba77d5..a5227ae3d637 100644 > --- a/drivers/dma-buf/dma-buf.c > +++ b/drivers/dma-buf/dma-buf.c > @@ -1628,7 +1628,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused) > > > spin_lock(&buf_obj->name_lock); > - seq_printf(s, "%08zu\t%08x\t%08x\t%08ld\t%s\t%08lu\t%s\n", > + seq_printf(s, "%08zu\t%08x\t%08lx\t%08ld\t%s\t%08lu\t%s\n", > buf_obj->size, > buf_obj->file->f_flags, buf_obj->file->f_mode, > file_count(buf_obj->file), > diff --git a/include/linux/types.h b/include/linux/types.h > index 253168bb3fe1..49c754fde1d6 100644 > --- a/include/linux/types.h > +++ b/include/linux/types.h > @@ -153,7 +153,7 @@ typedef u32 dma_addr_t; > > typedef unsigned int __bitwise gfp_t; > typedef unsigned int __bitwise slab_flags_t; > -typedef unsigned int __bitwise fmode_t; > +typedef unsigned long __bitwise fmode_t; > > #ifdef CONFIG_PHYS_ADDR_T_64BIT > typedef u64 phys_addr_t; > -- > 2.35.3 > -- Jan Kara SUSE Labs, CR