diff mbox series

[2/2] NFSD: Fix EXCLUSIVE paths in do_nfsd_create()

Message ID 164847700195.23692.9618617591917178500.stgit@klimt.1015granger.net (mailing list archive)
State New, archived
Headers show
Series [1/2] NFSD: Prevent lock/unlock imbalance in do_nfsd_create() | expand

Commit Message

Chuck Lever March 28, 2022, 2:16 p.m. UTC
The "out" label already invokes fh_drop_write().

Fixes: 4a55c1017b8d ("nfsd: Push mnt_want_write() outside of i_mutex")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/vfs.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index f54da591a5bf..9dee15431175 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1480,7 +1480,6 @@  do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		case NFS3_CREATE_GUARDED:
 			err = nfserr_exist;
 		}
-		fh_drop_write(fhp);
 		goto out;
 	}
 
@@ -1488,10 +1487,8 @@  do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		iap->ia_mode &= ~current_umask();
 
 	host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true);
-	if (host_err < 0) {
-		fh_drop_write(fhp);
+	if (host_err < 0)
 		goto out_nfserr;
-	}
 	if (created)
 		*created = true;