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 21103C4332F for ; Wed, 8 Nov 2023 20:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229555AbjKHUHB (ORCPT ); Wed, 8 Nov 2023 15:07:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjKHUHA (ORCPT ); Wed, 8 Nov 2023 15:07:00 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84C531BD5 for ; Wed, 8 Nov 2023 12:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=2TjKG/GoIGXbftz95FEm5U05xH5Q9cOJ2ZeW1k72gM4=; t=1699474018; x=1700683618; b=EF31lJd6txHcocZMAxZrdTBLbn0fv5E1oWiIVoMB+1VdZ5g 5hgIN7qBdc0AAXASQvmUT/8tV8xnPyUFoUlN/GyhpUZ4ZVWgh0prlLZoRgcNY/A9qh1SOBkQWbuzv wKp7j65VEE1nCIIoRfQby5JqfjPwBxUTGj+hDb58+Vl2o+xp6QFB7fv+IRTAxyH4ZgFx5IO11PCpK SSbsbWqD7FFJ0cpGf52kImsuaXgoxiRru8MwRsiygypl7k5+LzqR1XWLFuKhRo2savUSd3a7Jbe4U DwGllcjNdExjCrdPGfV3jNxNgHNNlrlhsTGGAOlXtNFVIfrcuFlW5zENUUaDgULQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r0opD-00000000kn5-4AK8; Wed, 08 Nov 2023 21:06:56 +0100 Message-ID: <8276773301ab22811283012be1c0fc2645f680c3.camel@sipsolutions.net> Subject: Re: 6.7.0-rc1 + hacks deadlock bug, wifi netdev delete + cat of debugfs file. From: Johannes Berg To: Ben Greear , linux-wireless Cc: Nicolai Stange Date: Wed, 08 Nov 2023 21:06:55 +0100 In-Reply-To: <91f66433-7eb9-4916-953e-6587f9ff5944@candelatech.com> References: <56d0b043-0585-5380-5703-f25d9a42f39d@candelatech.com> <0cfd8ae0577e52fe8db41dbfb37ee5197a1857d6.camel@sipsolutions.net> <21a4b983-1d5c-8c76-0994-d8a43285b19d@candelatech.com> <6abad7701a110116a49e54f908a9ab9422a8e6ad.camel@sipsolutions.net> <91f66433-7eb9-4916-953e-6587f9ff5944@candelatech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2023-11-08 at 12:04 -0800, Ben Greear wrote: > On 11/8/23 10:43, Johannes Berg wrote: > > On Wed, 2023-11-08 at 09:44 -0800, Ben Greear wrote: > > >=20 > > > This method appears to actually set a S_DEAD flag in the dentry, > > >=20 > >=20 > > A *dir* entry. > >=20 > > > so maybe > > > we just check that flag in the mutex_trylock failed to acquire path > > > in the debugfs read? > > >=20 > > > void simple_recursive_removal(struct dentry *dentry, > > > void (*callback)(struct dentry *)) > > > { > > > struct dentry *this =3D dget(dentry); > > > while (true) { > > > struct dentry *victim =3D NULL, *child; > > > struct inode *inode =3D this->d_inode; > > >=20 > > > inode_lock(inode); > > > if (d_is_dir(this)) > > > inode->i_flags |=3D S_DEAD; > > >=20 > >=20 > > But even if you did that, I'm not sure what you'd do? trylock and sleep= , > > and abort if you find it's being removed? That all sounds super awkward= . >=20 > Here is my compile-only tested approach. It only tries to fix one partic= ular > locking case in debugfs, so I'm sure it is not yet complete. I believe I > need to add that new flag in the fs.h, as S_DEAD is only for directories, > if I understand the code properly. [snip code] Sure, it's just software. You can do whatever you want with it. But ... there's no way anything even similar to this will ever go upstream. johannes