Skip to content

Commit

Permalink
NFS: Fix missing unlock in nfs_unlink()
Browse files Browse the repository at this point in the history
Add the missing unlock before goto.

Fixes: 3c59366 ("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>
  • Loading branch information
Sun Ke authored and Trond Myklebust committed Aug 13, 2022
1 parent 3fa5cbd commit 2067231
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2067231

Please sign in to comment.