From 7b7a8ca43fcf027f8aabd7c0629c2d39bfd97300 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 10 Mar 2025 00:34:08 -0400 Subject: [PATCH] pstore: switch to locked_recursive_removal() rather than playing with manual d_invalidate() Reviewed-by: Christian Brauner Signed-off-by: Al Viro --- fs/pstore/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index bb3b769edc715..1a2e1185426ca 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -300,7 +300,7 @@ static struct dentry *psinfo_lock_root(void) return NULL; root = pstore_sb->s_root; - inode_lock(d_inode(root)); + inode_lock_nested(d_inode(root), I_MUTEX_PARENT); return root; } @@ -318,8 +318,7 @@ int pstore_put_backend_records(struct pstore_info *psi) list_for_each_entry_safe(pos, tmp, &records_list, list) { if (pos->record->psi == psi) { list_del_init(&pos->list); - d_invalidate(pos->dentry); - simple_unlink(d_inode(root), pos->dentry); + locked_recursive_removal(pos->dentry, NULL); pos->dentry = NULL; } } -- 2.47.2