git: 4cbd728cb153 - stable/13 - fdesc_lookup(): drop fdropped

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 06 Apr 2023 18:04:31 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=4cbd728cb1535b850e9db3a965bfda6a6629bba8

commit 4cbd728cb1535b850e9db3a965bfda6a6629bba8
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-03-23 19:30:04 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-04-06 18:04:10 +0000

    fdesc_lookup(): drop fdropped
    
    (cherry picked from commit 13262b07a06910edd5e58e6bb2e1d4786a7b7d8e)
---
 sys/fs/fdescfs/fdesc_vnops.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index e8aa9f81dc2e..85a3c12f3419 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -302,7 +302,6 @@ fdesc_lookup(struct vop_lookup_args *ap)
 	int nlen = cnp->cn_namelen;
 	u_int fd, fd1;
 	int error;
-	bool fdropped;
 	struct vnode *fvp;
 
 	if ((cnp->cn_flags & ISLASTCN) &&
@@ -346,7 +345,6 @@ fdesc_lookup(struct vop_lookup_args *ap)
 	 */
 	if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0)
 		goto bad;
-	fdropped = false;
 
 	/*
 	 * Make sure we do not deadlock looking up the dvp itself.
@@ -362,19 +360,17 @@ fdesc_lookup(struct vop_lookup_args *ap)
 	arg.ix = FD_DESC + fd;
 	arg.fp = fp;
 	arg.td = td;
-	arg.fdropped = fdropped;
+	arg.fdropped = false;
 	error = vn_vget_ino_gen(dvp, fdesc_get_ino_alloc, &arg,
 	    LK_EXCLUSIVE, &fvp);
-	fdropped = arg.fdropped;
 
-	if (!fdropped) {
+	if (!arg.fdropped) {
 		/*
 		 * In case we're holding the last reference to the file, the dvp
 		 * will be re-acquired.
 		 */
 		VOP_UNLOCK(dvp);
 		fdrop(fp, td);
-		fdropped = true;
 
 		vn_lock(dvp, LK_RETRY | LK_EXCLUSIVE);
 		fvp = dvp;