From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B53BC43334 for ; Sat, 11 Jun 2022 12:13:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229659AbiFKMNS (ORCPT ); Sat, 11 Jun 2022 08:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiFKMNO (ORCPT ); Sat, 11 Jun 2022 08:13:14 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C4C68DDFB; Sat, 11 Jun 2022 05:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=atgndddR6SXbIyqaExtJZJhw3ic+UgK9VwWvZJVDRqM=; b=DTBELQ0XOtAet4aUT4efB1q+ia sP7gw1tag71Ut9T9J0Y25hndtEHuQORviFREhu65NZ0JgunSjujQajXnFDN3Uhx2zyhojxkmZdwl0 qFbkPtFs+jzPUrd06AFHJ66iAw0ZejUG7QGBkdYtMMAUYvF9gwQ6+Ge5hl2MN67J7+9sdYld9SbYL 7zB8a17jvdMvDNcoBdbiC4mM+jU2vVpWX0/p6VbQ5opblAuQF9I0QDAwkqUReQnlGVQzFY2iASRbs tjceebpiSFE/FT8okP3RGX3Tw9QnTYrgEfjEhqkRpch/IGE+mV1sULTrAUnDj20FxAqpoFnIyfoHN le1+vSDQ==; Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzzyx-0065U6-SO; Sat, 11 Jun 2022 12:12:48 +0000 Date: Sat, 11 Jun 2022 12:12:47 +0000 From: Al Viro To: Sudip Mukherjee Cc: David Howells , Dominique Martinet , Mike Marshall , Gao Xiang , linux-afs@lists.infradead.org, v9fs-developer@lists.sourceforge.net, devel@lists.orangefs.org, linux-erofs@lists.ozlabs.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: mainline build failure due to 6c77676645ad ("iov_iter: Fix iter_xarray_get_pages{,_alloc}()") Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 11, 2022 at 11:45:03AM +0100, Sudip Mukherjee wrote: > Hi All, > > The latest mainline kernel branch fails to build for "arm allmodconfig", > "xtensa allmodconfig" and "csky allmodconfig" with the error: > > In file included from ./include/linux/kernel.h:26, > from ./include/linux/crypto.h:16, > from ./include/crypto/hash.h:11, > from lib/iov_iter.c:2: > lib/iov_iter.c: In function 'iter_xarray_get_pages': > ./include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast [-Werror] > 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) > | ^~ > ./include/linux/minmax.h:26:18: note: in expansion of macro '__typecheck' > 26 | (__typecheck(x, y) && __no_side_effects(x, y)) > | ^~~~~~~~~~~ > ./include/linux/minmax.h:36:31: note: in expansion of macro '__safe_cmp' > 36 | __builtin_choose_expr(__safe_cmp(x, y), \ > | ^~~~~~~~~~ > ./include/linux/minmax.h:45:25: note: in expansion of macro '__careful_cmp' > 45 | #define min(x, y) __careful_cmp(x, y, <) > | ^~~~~~~~~~~~~ > lib/iov_iter.c:1464:16: note: in expansion of macro 'min' > 1464 | return min(nr * PAGE_SIZE - offset, maxsize); > | ^~~ > lib/iov_iter.c: In function 'iter_xarray_get_pages_alloc': > ./include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast [-Werror] > 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) > | ^~ > ./include/linux/minmax.h:26:18: note: in expansion of macro '__typecheck' > 26 | (__typecheck(x, y) && __no_side_effects(x, y)) > | ^~~~~~~~~~~ > ./include/linux/minmax.h:36:31: note: in expansion of macro '__safe_cmp' > 36 | __builtin_choose_expr(__safe_cmp(x, y), \ > | ^~~~~~~~~~ > ./include/linux/minmax.h:45:25: note: in expansion of macro '__careful_cmp' > 45 | #define min(x, y) __careful_cmp(x, y, <) > | ^~~~~~~~~~~~~ > lib/iov_iter.c:1628:16: note: in expansion of macro 'min' > 1628 | return min(nr * PAGE_SIZE - offset, maxsize); > > > git bisect pointed to 6c77676645ad ("iov_iter: Fix iter_xarray_get_pages{,_alloc}()") At a guess, should be return min((size_t)nr * PAGE_SIZE - offset, maxsize); in both places. I'm more than half-asleep right now; could you verify that it (as the last lines of both iter_xarray_get_pages() and iter_xarray_get_pages_alloc()) builds correctly?