From nobody Wed Nov 27 15:46:09 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 375A2184528; Wed, 9 Oct 2024 08:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728461447; cv=none; b=rY7T3l0TEnlOFxhF8oS9B3YMp+gtvyqvzmT3peow9pHjsfUyonRjLKx/21nA7EJ5azmj1nVago5OCGAJLo3EFTOYvw/opk395eg18MHP9boKS+72AxX5MA6XYEreu8ltf5pmZLLpzXyRgQK6hAavzS/YUY99EHuTby18xcixDU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728461447; c=relaxed/simple; bh=o7vzIwux/mRlQjF2CrbH+84suPWkVeoqpQYiU3l8qXk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NzogxYe3NxAj4VQXrdclaC+aF8BT2GaLhm2ZTPx089G4tmWsADe15VgsbhR3h6s+yQ9ie7D8pjQnqhgzvjVjS+e3SdK5hZmmkoa0YZL37id9E1CzA3sLuCGDYMHgWhXIV+GhM1B7BlFsGM57B1dp2VlQa/MQIMg86vkHQogb+TQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gM6wPfYh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gM6wPfYh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1E60C4CECE; Wed, 9 Oct 2024 08:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728461446; bh=o7vzIwux/mRlQjF2CrbH+84suPWkVeoqpQYiU3l8qXk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gM6wPfYh9DxbCyOU+rMSPoYE0H5iLvnx8csSDvxAejY7jxtIuZ+q6Klhk2L2zCdZW GhVcAc0yoD0QYuYCcYmKsem0ssgHOjj7L5g5LB/TUJd/namboJUHypwE68mHVkIbAh iv8UZYF+t5AQE3/BRvMrStMWgzUJ+oXUBAJaEU5D4WnUy8VjHPaIUXLEeBgbktn/pi PyxmvavZv1v82yPhxAiikotkV32Wm28pb+zysFCz9Sd0wr0BomyIsiS/ikDHPMRLI+ GRfw7Bw3a/FkbCQpCH3rmViW1pgMXduJRQK2HCNR5KtPDWGi4x8XdDxskF8tUS2Oko 5l257JTi3xnJA== Date: Wed, 9 Oct 2024 10:10:41 +0200 From: Ingo Molnar To: NeilBrown Cc: Stephen Rothwell , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Kent Overstreet , Linux Kernel Mailing List , Linux Next Mailing List Subject: [PATCH] fs/bcachefs: Fix __wait_on_freeing_inode() definition of waitqueue entry Message-ID: References: <20241009144511.5fd62c94@canb.auug.org.au> <172844652013.444407.16580824583469743404@noble.neil.brown.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <172844652013.444407.16580824583469743404@noble.neil.brown.name> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" * NeilBrown wrote: > On Wed, 09 Oct 2024, Stephen Rothwell wrote: > > Hi all, > >=20 > > After merging the tip tree, today's linux-next build (x86_64 allmodconf= ig) > > failed like this: > >=20 > > In file included from include/linux/fs.h:6, > > from include/linux/highmem.h:5, > > from include/linux/bvec.h:10, > > from include/linux/blk_types.h:10, > > from include/linux/bio.h:10, > > from fs/bcachefs/bcachefs.h:188, > > from fs/bcachefs/fs.c:4: > > fs/bcachefs/fs.c: In function '__wait_on_freeing_inode': > > fs/bcachefs/fs.c:281:31: error: initialization of 'long unsigned int *'= from incompatible pointer type 'u32 *' {aka 'unsigned int *'} [-Wincompati= ble-pointer-types] > > 281 | DEFINE_WAIT_BIT(wait, &inode->v.i_state, __I_NEW); >=20 > The fix we want is to replace that line with > struct wait_bit_queue_entry wait; > I should have checked more carefully - sorry. >=20 > I guess we wait for rc3? >=20 > Kent: could you please make that change? The inode_bit_waitqueue() does > initialisation equivalent of DEFINE_WAIT_BIT() so you only need the decla= ration. Since the breakage was introduced via tip:sched/core, I've applied the fix=20 below. Does this look good to you? Thanks, Ingo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> From: Ingo Molnar Date: Wed, 9 Oct 2024 10:00:09 +0200 Subject: [PATCH] fs/bcachefs: Fix __wait_on_freeing_inode() definition of w= aitqueue entry The following recent commit made DEFINE_WAIT_BIT() type requirements strict= er: 2382d68d7d43 ("sched: change wake_up_bit() and related function to expect= unsigned long *") .. which results in a build failure: > fs/bcachefs/fs.c: In function '__wait_on_freeing_inode': > fs/bcachefs/fs.c:281:31: error: initialization of 'long unsigned int *'= from incompatible pointer type 'u32 *' {aka 'unsigned int *'} [-Wincompati= ble-pointer-types] > 281 | DEFINE_WAIT_BIT(wait, &inode->v.i_state, __I_NEW); Since this code relies on the waitqueue initialization within inode_bit_waitqueue() anyway, the DEFINE_WAIT_BIT() initialization is unnecessary - we can just declare a waitqueue entry. Reported-by: Stephen Rothwell Suggested-by: NeilBrown Signed-off-by: Ingo Molnar --- fs/bcachefs/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 5bfc26d58270..c410133541ba 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -183,8 +183,9 @@ static void __wait_on_freeing_inode(struct bch_fs *c, struct bch_inode_info *inode, subvol_inum inum) { + struct wait_bit_queue_entry wait; wait_queue_head_t *wq; - DEFINE_WAIT_BIT(wait, &inode->v.i_state, __I_NEW); + wq =3D inode_bit_waitqueue(&wait, &inode->v, __I_NEW); prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE); spin_unlock(&inode->v.i_lock);