Re: [PATCH] kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR
From: Tejun Heo
Date: Mon May 22 2023 - 15:08:54 EST
On Tue, May 16, 2023 at 11:45:36AM +0800, Muchun Song wrote:
> @@ -655,7 +660,7 @@ static struct kernfs_node *__kernfs_new_node(struct kernfs_root *root,
> return kn;
>
> err_out3:
> - idr_remove(&root->ino_idr, (u32)kernfs_ino(kn));
> + kernfs_idr_remove(root, kn);
Good catch but I'd just open code the locking here.
Thanks.
--
tejun