Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp260404lqb; Tue, 16 Apr 2024 15:09:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpJ2w8Nf1UJ6mz6ShBBf3hF7oyww3ArqZdjFvOFoK97FynsE1UsxzVoVp4cBSmrSVLV0yFUiB+Wgk168cNDcsZLUKGK2BmDIPl4kYx0A== X-Google-Smtp-Source: AGHT+IGFJlSxOt1PD7EEQCr3M8Dg9CuX+QZ9Gw7KOreAlzGnipt1sQq3ZhgIbDfuHRpNejBSWo8A X-Received: by 2002:a05:6a21:2d07:b0:1aa:5f30:9765 with SMTP id tw7-20020a056a212d0700b001aa5f309765mr1856558pzb.44.1713305358280; Tue, 16 Apr 2024 15:09:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713305358; cv=pass; d=google.com; s=arc-20160816; b=g/tGf5oBEUnDBkTbjXBsGkJBLitXSADjXUafTfLzeDGbJLpSm5UL0yQIH5vFiUl+dc 5nv6dii4VMbUC9G6zJwaDcmbSfeDgOFPdgGdeVKKe6pJ9p2KwEY2uFCbXYDUuNJtr6uJ NNYiofolDzvulKlIVZVtbg9q6s/OFH+QVisEWtt/m92No/JRxnGuROAS92fxQmAJi3AN nVy+TaB//jS0/sAOMVtNAHyqRFx8dqRwCwDJtx3pS90lIqejjHhEe+K8qEkvc37F79sr mxmGo3WuaHMJsrTz1COB0aNv2BjDNj2KnTuJsYQ7Qg4rN+PiWYwwTP1vr/pWyMP7kgR+ u1aQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=4a0PGrEMu5XdQTilCmMwlfM2e10kXfm2bWbg/3JQ9fE=; fh=vfIjHzf/XJp+YXYfA9janm78Qg2b+ZXn3/8y2iTKAw0=; b=kbhAmE+N9tpl2eUGmRxoXNgTMGlNyle55t4afySDl85sntTU5tKV3G7GszodygLERt Ra77ywwjVc9fvVFflwJ/9tm9AsDFJ5Ou/hKH1OVjJTG0I/pFiY3MDEdO/qOXZVByU4iQ cRvAwt3mWZkUzHsn5yneRwgbtrMCXNBL78ZJy89nwQjsvR8sQR5I03+2BBknxbZcamKa i9+35C6LpIvPtuirDIJjYZAVKpA8NtPhPq5Gj1vao3jCovPzu6FBU7n+a3MgB+2SSnjT caAoVT72eAcJ9oytXXGyf7QzErfhEw03Q3uC36N2eG3XuIbqrtjbg0SBbGwHc8cTlgfa NWTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=FI5YlVQU; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-147669-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f17-20020a656291000000b005dc6d16be5csi9837464pgv.439.2024.04.16.15.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 15:09:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147669-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=FI5YlVQU; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-147669-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F2018283057 for ; Tue, 16 Apr 2024 22:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1B3778C7F; Tue, 16 Apr 2024 22:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FI5YlVQU" Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 810536E61A for ; Tue, 16 Apr 2024 22:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713305352; cv=none; b=Gb75EffkseY0OsExtJJDRL85DvZ7PYqh4JlCgA0+XMTzWTzbyxAaur8GZSk9Vt3nYqFsf65d8/TrqqcVNYSWVRmj+xYDUlBFFRDzDEA++9qdaL3YNsrexglwxtzpUEUy8TAL5XchUxmnO02Rqc75O65QrCFykrY+VLjBgkvirC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713305352; c=relaxed/simple; bh=cceio2i2g+XpMA67ZaweBAe8aJQ465GCa8o/ranK5qM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IakaKyIOtQTBZf8cEDAlX6xbTJornVZuctURRvM8oDudo3sXHzYlH+BX7uxvfQDV9DoYFonUqCb0jSzXw+dQgVrwnXCvvH13rEjy8ANKnaRXdYWWy/leA48h/zgSXPhdLe50lQNeV/NELgZ1Gg3rNdOMJtH0s7hv9l66hRdk5Fg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FI5YlVQU; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Tue, 16 Apr 2024 18:09:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1713305348; h=from:from:reply-to:subject:subject: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=4a0PGrEMu5XdQTilCmMwlfM2e10kXfm2bWbg/3JQ9fE=; b=FI5YlVQU7/PZdq56uBNG41rfudamqGUdSMoeKgpiy+XntCQV87bD7yZTFCey4SzZ1+1XFH FyGrHrXmsoC9bfh84x2/qCOhy3JZXpf5na6M8NPndnzBKC0hmzMvSd9Hk90/sYyR5fp1nF 8k7rJcky9EPu15hEPYS/3Q00EKGt5ws= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Nathan Chancellor Cc: bfoster@redhat.com, linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] bcachefs: Fix format specifier in validate_bset_keys() Message-ID: References: <20240416-bcachefs-fix-format-specifier-validate_bset_keys-v1-1-3ea2cdf28b12@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240416-bcachefs-fix-format-specifier-validate_bset_keys-v1-1-3ea2cdf28b12@kernel.org> X-Migadu-Flow: FLOW_OUT On Tue, Apr 16, 2024 at 08:16:02AM -0700, Nathan Chancellor wrote: > When building for 32-bit platforms, for which size_t is 'unsigned int', > there is a warning from a format string in validate_bset_keys(): > > fs/bcachefs/btree_io.c: In function 'validate_bset_keys': > fs/bcachefs/btree_io.c:891:34: error: format '%lu' expects argument of type 'long unsigned int', but argument 12 has type 'unsigned int' [-Werror=format=] > 891 | "bad k->u64s %u (min %u max %lu)", k->u64s, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > fs/bcachefs/btree_io.c:603:32: note: in definition of macro 'btree_err' > 603 | msg, ##__VA_ARGS__); \ > | ^~~ > fs/bcachefs/btree_io.c:887:21: note: in expansion of macro 'btree_err_on' > 887 | if (btree_err_on(!bkeyp_u64s_valid(&b->format, k), > | ^~~~~~~~~~~~ > fs/bcachefs/btree_io.c:891:64: note: format string is defined here > 891 | "bad k->u64s %u (min %u max %lu)", k->u64s, > | ~~^ > | | > | long unsigned int > | %u > cc1: all warnings being treated as errors > > BKEY_U64s is size_t so the entire expression is promoted to size_t. Use > the '%zu' specifier so that there is no warning regardless of the width > of size_t. > > Fixes: 031ad9e7dbd1 ("bcachefs: Check for packed bkeys that are too big") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202404130747.wH6Dd23p-lkp@intel.com/ > Closes: https://lore.kernel.org/oe-kbuild-all/202404131536.HdAMBOVc-lkp@intel.com/ > Signed-off-by: Nathan Chancellor Thanks, applied