The branch main has been updated by trasz:

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

commit b8073b3c74342113398f36a1c68f442ae9e092e6
Author:     Edward Tomasz Napierala <tr...@freebsd.org>
AuthorDate: 2021-01-31 21:37:41 +0000
Commit:     Edward Tomasz Napierala <tr...@freebsd.org>
CommitDate: 2021-01-31 21:37:44 +0000

    msdosfs: fix vnode leak with msdosfs_rename()
    
    This could happen when failing due to disappearing source file.
    
    Reviewed By:    kib
    Tested by:      pho
    Sponsored by:   NetApp, Inc.
    Sponsored by:   Klara, Inc.
    Differential Revision: https://reviews.freebsd.org/D27338
---
 sys/fs/msdosfs/msdosfs_vnops.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index e1e679d92146..8885ac856588 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -1122,6 +1122,14 @@ abortit:
                        VOP_UNLOCK(tdvp);
                vrele(tdvp);
                vrele(ap->a_fvp);
+               /*
+                * fdvp may be locked and has a reference. We need to
+                * release the lock and reference, unless to and from
+                * directories are the same.  In that case it is already
+                * unlocked.
+                */
+               if (tdvp != fdvp)
+                       vput(fdvp);
                return 0;
        }
        xp = VTODE(fvp);
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to