NFS: Fix missing unlock in nfs_unlink()

Add the missing unlock before goto.

Fixes: 3c59366c20 ("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>
This commit is contained in:
Sun Ke 2022-08-12 09:14:40 +08:00 committed by Trond Myklebust
parent 3fa5cbdc44
commit 2067231a9e
1 changed files with 3 additions and 1 deletions

View File

@ -2484,8 +2484,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);