]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfsd: switch purge_old() to use start_removing_noperm()
authorNeilBrown <neil@brown.name>
Tue, 24 Feb 2026 22:16:52 +0000 (09:16 +1100)
committerChristian Brauner <brauner@kernel.org>
Fri, 6 Mar 2026 09:24:12 +0000 (10:24 +0100)
Rather than explicit locking, use the start_removing_noperm() and
end_removing() wrappers.
This was not done with other start_removing changes due to conflicting
in-flight patches.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260224222542.3458677-8-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/nfsd/nfs4recover.c

index b4bf85f96f6ec081a1ec97d637d1e50fa8496f39..b338473d6e52d13effc38ae70396e768f8bacd1e 100644 (file)
@@ -352,16 +352,14 @@ purge_old(struct dentry *parent, char *cname, struct nfsd_net *nn)
        if (nfs4_has_reclaimed_state(name, nn))
                goto out_free;
 
-       inode_lock_nested(d_inode(parent), I_MUTEX_PARENT);
-       child = lookup_one(&nop_mnt_idmap, &QSTR(cname), parent);
+       child = start_removing_noperm(parent, &QSTR(cname));
        if (!IS_ERR(child)) {
                status = vfs_rmdir(&nop_mnt_idmap, d_inode(parent), child, NULL);
                if (status)
                        printk("failed to remove client recovery directory %pd\n",
                               child);
-               dput(child);
        }
-       inode_unlock(d_inode(parent));
+       end_removing(child);
 
 out_free:
        kfree(name.data);