diff options
| author | Neil Brown <neil@brown.name> | 2025-11-27 11:48:56 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-11-28 09:51:16 +0100 |
| commit | eeec741ee0df36e79a847bb5423f9eef4ed96071 (patch) | |
| tree | a3b403fe472ec1a2666b7192652052de526fd7b8 /fs/nfsd/vfs.c | |
| parent | 523ac768800c95d34522e8e33775bf911b883fe2 (diff) | |
nfsd: fix end_creating() conversion
Avoid a double-unlock as nfs_create_locked() will have unlocked the
parent and do the dput() manually.
Christian Brauner <brauner@kernel.org> says:
I've taken Neil's proposed fix from [1] and added a commit message.
Fixes: https://lore.kernel.org/202511252132.2c621407-lkp@intel.com [1]
Fixes: bd6ede8a06e8 ("VFS/nfsd/cachefiles/ovl: introduce start_removing() and end_removing()")
Signed-off-by: Neil Brown <neil@brown.name>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/nfsd/vfs.c')
| -rw-r--r-- | fs/nfsd/vfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 6e9a57863904..6a6019368940 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1633,16 +1633,14 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, return nfserrno(host_err); err = fh_compose(resfhp, fhp->fh_export, dchild, fhp); - /* - * We unconditionally drop our ref to dchild as fh_compose will have - * already grabbed its own ref for it. - */ if (err) goto out_unlock; err = fh_fill_pre_attrs(fhp); if (err != nfs_ok) goto out_unlock; err = nfsd_create_locked(rqstp, fhp, attrs, type, rdev, resfhp); + /* nfsd_create_locked() unlocked the parent */ + dput(dchild); return err; out_unlock: |