diff options
author | Sun Ke <sunke32@huawei.com> | 2022-08-12 09:14:40 +0800 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-08-13 13:02:13 -0400 |
commit | 2067231a9e2cbbcae0a4aca6ac36ff2dd6a7b701 (patch) | |
tree | f10ae762d95b8ba57fcc995ab4b464c1a51fcf1b /fs/nfs | |
parent | 3fa5cbdc44de190f2c5605ba7db015ae0d26f668 (diff) |
NFS: Fix missing unlock in nfs_unlink()
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index dbab3caa15ed..1b879584d4fe 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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); |