On Wed, 2023-11-08 at 09:44 -0800, Ben Greear wrote: > > This method appears to actually set a S_DEAD flag in the dentry, > A *dir* entry. > so maybe > we just check that flag in the mutex_trylock failed to acquire path > in the debugfs read? > > void simple_recursive_removal(struct dentry *dentry, > void (*callback)(struct dentry *)) > { > struct dentry *this = dget(dentry); > while (true) { > struct dentry *victim = NULL, *child; > struct inode *inode = this->d_inode; > > inode_lock(inode); > if (d_is_dir(this)) > inode->i_flags |= S_DEAD; > 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. johannes