]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: Fix missing unlock in nfs_unlink()
authorSun Ke <sunke32@huawei.com>
Fri, 12 Aug 2022 01:14:40 +0000 (09:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:40 +0000 (13:09 +0100)
commit 2067231a9e2cbbcae0a4aca6ac36ff2dd6a7b701 upstream.

Add the missing unlock before goto.

Fixes: 3c59366c207e ("NFS: don't unhash dentry during unlink/rename")
Signed-off-by: Sun Ke <sunke32@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/dir.c

index 6dd56841feab9648a449d04462259e439836f870..cf28812b0403d62c7eaa28aa25fe2f91c5219cc8 100644 (file)
@@ -2331,8 +2331,10 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry)
         */
        error = -ETXTBSY;
        if (WARN_ON(dentry->d_flags & DCACHE_NFSFS_RENAMED) ||
-           WARN_ON(dentry->d_fsdata == NFS_FSDATA_BLOCKED))
+           WARN_ON(dentry->d_fsdata == NFS_FSDATA_BLOCKED)) {
+               spin_unlock(&dentry->d_lock);
                goto out;
+       }
        if (dentry->d_fsdata)
                /* old devname */
                kfree(dentry->d_fsdata);