From: Sun Ke Date: Fri, 12 Aug 2022 01:14:40 +0000 (+0800) Subject: NFS: Fix missing unlock in nfs_unlink() X-Git-Tag: v5.15.198~346 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=460fd9a9e820d93444f8a52fb195f17386626634;p=thirdparty%2Fkernel%2Fstable.git NFS: Fix missing unlock in nfs_unlink() commit 2067231a9e2cbbcae0a4aca6ac36ff2dd6a7b701 upstream. Add the missing unlock before goto. Fixes: 3c59366c207e ("NFS: don't unhash dentry during unlink/rename") Signed-off-by: Sun Ke Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 6dd56841feab9..cf28812b0403d 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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);