From: Chuck Lever <chuck.lever@oracle.com> To: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk Subject: [PATCH v2 2/8] NFSD: Avoid calling fh_drop_write() twice in do_nfsd_create() Date: Sat, 14 May 2022 12:37:35 -0400 [thread overview] Message-ID: <165254625505.2361.1645987290547479626.stgit@bazille.1015granger.net> (raw) In-Reply-To: <165254610700.2361.2480451215356922637.stgit@bazille.1015granger.net> Clean up: The "out" label already invokes fh_drop_write(). Note that fh_drop_write() is already careful not to invoke mnt_drop_write() if either it has already been done or there is nothing to drop. Therefore no change in behavior is expected. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- fs/nfsd/vfs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 4c1984f07cdc..bbed7a986784 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1479,7 +1479,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; } @@ -1487,10 +1486,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;
next prev parent reply other threads:[~2022-05-14 16:37 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-14 16:37 [PATCH v2 0/8] Make NFSv4 OPEN(CREATE) less brittle Chuck Lever 2022-05-14 16:37 ` [PATCH v2 1/8] NFSD: Clean up nfsd3_proc_create() Chuck Lever 2022-05-14 16:37 ` Chuck Lever [this message] 2022-05-14 16:37 ` [PATCH v2 3/8] NFSD: Refactor nfsd_create_setattr() Chuck Lever 2022-05-14 16:37 ` [PATCH v2 4/8] NFSD: Refactor NFSv3 CREATE Chuck Lever 2022-05-14 16:37 ` [PATCH v2 5/8] NFSD: Refactor NFSv4 OPEN(CREATE) Chuck Lever 2022-05-14 16:38 ` [PATCH v2 6/8] NFSD: Remove do_nfsd_create() Chuck Lever 2022-05-14 16:38 ` [PATCH v2 7/8] NFSD: Clean up nfsd_open_verified() Chuck Lever 2022-05-14 16:38 ` [PATCH v2 8/8] NFSD: Instantiate a struct file when creating a regular NFSv4 file Chuck Lever 2022-05-23 15:03 ` Chuck Lever III
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=165254625505.2361.1645987290547479626.stgit@bazille.1015granger.net \ --to=chuck.lever@oracle.com \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-nfs@vger.kernel.org \ --cc=viro@zeniv.linux.org.uk \ --subject='Re: [PATCH v2 2/8] NFSD: Avoid calling fh_drop_write() twice in do_nfsd_create()' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.