From patchwork Fri Nov 8 21:38:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 179004 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3316999ilf; Fri, 8 Nov 2019 13:39:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyPYkbVIdlp6uqoZV9XSXMvQ5X67QVU/330BCB0aS6AhILi3ujk+X8oaxkZKxIzWICyZfYc X-Received: by 2002:a17:906:298b:: with SMTP id x11mr11090609eje.257.1573249140911; Fri, 08 Nov 2019 13:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573249140; cv=none; d=google.com; s=arc-20160816; b=YG9eRt40zBKrxthKpqMFewd46MCwUZHyMcOVe6aBNrnXJ65JGFOvbGQyA44AIwqECU zjakURcgfZSBuUYKfG3Y6tKijggwEcnvoDJjungt1I7JGwIOIr/doaLQ3UKzsHRuNI0c wMi01ds/uLEe0itNNT+Y/fcbiAxkP74cCrcdeudYHuU2Zg7jCofe+9tgI6Nhf0fgA6ls foAxhgzXVsaE+D1y7KXxXtZRh+cT8j5rmMoCd+OyXUJKWW4AAa0y6gFmMZT4U8+ZOXhl N2fHUGeT0yckGm2GuiBMx6RqeLs2P0MtyNEKoQL0niuOhY8h3clzjb5j65oDLLx4ropD 49Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xxdRB79VmITNve+Q8jCNYAz4BALhbKbs9bPC7wWPf34=; b=0LCzxegPTkcQLKOiU2IlrHOTvvrYPAA/KbEhY0VmT0uaGTjyzi7lNoD/npkYBiGC+C TagvL/7FXM/n3BV/OepXyzRg5b1RV3wcy6GvOelDO8naDRLvZLQTU7UpsrG3LZrdlBXK eIIei33mvlk7g7THGZx0jPR5y9A14sS9wMpnmbj5mHLxbLzJeu73fWxwPl7/HaEIrCpA Hzt/GnXma7TY7oxCTO4MgrW2E4S8FZt7zhc+zUr14RrQ3NALu+ftf+dPpOLZ6uoCtyPc tm4xHsW2mtie0snOBuWZsmTajOx3YoZaAZ207yLB0FmvmPVpMwDT18bcuaUpqcD/SdGQ X3bA== 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 y61si5431717ede.24.2019.11.08.13.39.00; Fri, 08 Nov 2019 13:39:00 -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 S2388574AbfKHVi6 (ORCPT + 26 others); Fri, 8 Nov 2019 16:38:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:45844 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730009AbfKHVi5 (ORCPT ); Fri, 8 Nov 2019 16:38:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 08A9FB192; Fri, 8 Nov 2019 21:38:56 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: Qu Wenruo , David Sterba Cc: Johannes Thumshirn , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH next 1/2] btrfs: tree-checker: Fix error format string Date: Fri, 8 Nov 2019 22:38:52 +0100 Message-Id: <20191108213853.16635-2-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108213853.16635-1-afaerber@suse.de> References: <20191108213853.16635-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Färber Argument BTRFS_FILE_EXTENT_INLINE_DATA_START is defined as offsetof(), which returns type size_t, so we need %zu instead of %lu. This fixes a build warning on 32-bit arm: ../fs/btrfs/tree-checker.c: In function 'check_extent_data_item': ../fs/btrfs/tree-checker.c:230:43: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Wformat=] 230 | "invalid item size, have %u expect [%lu, %u)", | ~~^ | | | long unsigned int | %u Fixes: a31ccb4b7ba2 ("btrfs: tree-checker: Check item size before reading file extent type") Cc: Qu Wenruo Cc: David Sterba Signed-off-by: Andreas Färber --- fs/btrfs/tree-checker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.4 Acked-by: Geert Uytterhoeven diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index 493d4d9e0f79..092b8ece36d7 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -227,7 +227,7 @@ static int check_extent_data_item(struct extent_buffer *leaf, */ if (item_size < BTRFS_FILE_EXTENT_INLINE_DATA_START) { file_extent_err(leaf, slot, - "invalid item size, have %u expect [%lu, %u)", + "invalid item size, have %u expect [%zu, %u)", item_size, BTRFS_FILE_EXTENT_INLINE_DATA_START, SZ_4K); return -EUCLEAN; From patchwork Fri Nov 8 21:38:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 179005 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3317051ilf; Fri, 8 Nov 2019 13:39:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxGXwqjH/SdrNqHLlvMAst1JV0aO9Ur5o/4HwpxWk3KspWFBG1Unbes6+wMZxAMUALpo5dD X-Received: by 2002:aa7:c343:: with SMTP id j3mr12768886edr.4.1573249143800; Fri, 08 Nov 2019 13:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573249143; cv=none; d=google.com; s=arc-20160816; b=h8MElO2KQFws1BzwhBWjKxK58EUtthFVoN7khrzoAjLvK+wUO6ZBRGj09alL+cGYfv McFV9FhhtkyvJRNjAY0Sz0suXAP/1U9MOL5k+8BMY+N2ZZdJccYfwZ+YUE9iVPcunYW8 gc7usDAekOX3so0+Dc527JQduBVDJa7nRMuya8FV+izxVLyPfRPi0w8WfyHeFIoSokJ7 4zgY+SUzx+iBwgWbvXoJ65Wjz8sOZa3DhW+NiBISToxPK3RMIEXE0nTg/RpobrFEBxYD nD1wsIagTts4GKJelRMkirYiabFvkP92gGUntS2yys0Pm7ZWPPgsmVElcqc8K7pbCr5Q zzEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ruAMYIjz6wX5NOvYcLYpAfGckTd1Q36sMes4TswonAM=; b=CJ4P0ZefQUqt62mrq64d6uvC0pHsSqCcgkZZyUpHh9xCrulvYutJhAOUPCXmmpiuCg CvDQTOETj6Dh8m93nTHQhA/Hn7X1Gxjc3Pmor1PDC/kcOaap7UpLB/kVBO8qewgJmbRV VR8xWJ74Y1TAiTCg7z5fUC8mccmWIeddXZSfc+cAT3L7FI6o70FUk1YCraiqu5BcZNKK Y3qyNaKa08UAzoG8XXlL94dtzmJcJLXmgU9jPigY/aEnBDRLo9vX3FRWbDMmJ3KeJFZB XjWtBN03XZAcUnqXvGXqo173GJlvkAS0/DI1THGaPENoJIt4iXQBs0Do56p4dxzzs2Up ZYZQ== 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 h14si5912167edj.225.2019.11.08.13.39.03; Fri, 08 Nov 2019 13:39:03 -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 S2388647AbfKHVjB (ORCPT + 26 others); Fri, 8 Nov 2019 16:39:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:45870 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731097AbfKHVi6 (ORCPT ); Fri, 8 Nov 2019 16:38:58 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 735B3B19A; Fri, 8 Nov 2019 21:38:56 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: Qu Wenruo , David Sterba Cc: Johannes Thumshirn , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH next 2/2] btrfs: extent-tree: Fix error format string Date: Fri, 8 Nov 2019 22:38:53 +0100 Message-Id: <20191108213853.16635-3-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191108213853.16635-1-afaerber@suse.de> References: <20191108213853.16635-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Färber sizeof() returns type size_t, thus we need %zu instead of %lu. This fixes the following build warning on 32-bit arm: In file included from ../include/linux/printk.h:7, from ../include/linux/kernel.h:15, from ../include/asm-generic/bug.h:19, from ../arch/arm/include/asm/bug.h:60, from ../include/linux/bug.h:5, from ../include/linux/thread_info.h:12, from ../include/asm-generic/current.h:5, from ./arch/arm/include/generated/asm/current.h:1, from ../include/linux/sched.h:12, from ../fs/btrfs/extent-tree.c:6: ../fs/btrfs/extent-tree.c: In function '__btrfs_free_extent': ../include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'unsigned int' [-Wformat=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ | ^~~~~~ ../include/linux/kern_levels.h:10:19: note: in expansion of macro 'KERN_SOH' 10 | #define KERN_CRIT KERN_SOH "2" /* critical conditions */ | ^~~~~~~~ ../fs/btrfs/ctree.h:2986:24: note: in expansion of macro 'KERN_CRIT' 2986 | btrfs_printk(fs_info, KERN_CRIT fmt, ##args) | ^~~~~~~~~ ../fs/btrfs/extent-tree.c:3207:4: note: in expansion of macro 'btrfs_crit' 3207 | btrfs_crit(info, | ^~~~~~~~~~ ../fs/btrfs/extent-tree.c:3208:83: note: format string is defined here 3208 | "invalid extent item size for key (%llu, %u, %llu) owner %llu, has %u expect >= %lu", | ~~^ | | | long unsigned int | %u Fixes: 0c171e9095e4 ("btrfs: extent-tree: Kill BUG_ON() in __btrfs_free_extent() and do better comment") Cc: Qu Wenruo Cc: David Sterba Signed-off-by: Andreas Färber --- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.4 diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 7c7a3e30e917..631c9743ddc7 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3205,7 +3205,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_tree_block_info *bi; if (unlikely(item_size < sizeof(*ei) + sizeof(*bi))) { btrfs_crit(info, -"invalid extent item size for key (%llu, %u, %llu) owner %llu, has %u expect >= %lu", +"invalid extent item size for key (%llu, %u, %llu) owner %llu, has %u expect >= %zu", key.objectid, key.type, key.offset, owner_objectid, item_size, sizeof(*ei) + sizeof(*bi));