git: a6ca6dfd60b6 - main - p9fs: remove duplicated code

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 13 Jul 2024 03:40:04 UTC
The branch main has been updated by imp:

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

commit a6ca6dfd60b66eec563bd473d96b31f0be1de80a
Author:     Danilo Egea Gondolfo <danilo@FreeBSD.org>
AuthorDate: 2024-07-09 19:07:18 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-13 03:40:09 +0000

    p9fs: remove duplicated code
    
    This code is using the vnode after it has been released and causing a
    panic when a p9fs shared volume is unmounted. In fact, it seems like it's
    just duplicated code left behind from a bad merge.
    
    PR:             279887
    Reported by:    Michael Dexter
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1323
---
 sys/fs/p9fs/p9fs_vnops.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c
index 5556e60f4bae..6ac0a7c008cc 100644
--- a/sys/fs/p9fs/p9fs_vnops.c
+++ b/sys/fs/p9fs/p9fs_vnops.c
@@ -125,16 +125,6 @@ p9fs_cleanup(struct p9fs_node *np)
 	/* Destroy the vm object and flush associated pages. */
 	vnode_destroy_vobject(vp);
 
-	/* Remove the vnode from hash list if vnode is not already deleted */
-	if ((np->flags & P9FS_NODE_DELETED) == 0)
-		vfs_hash_remove(vp);
-
-	/* Invalidate all entries to a particular vnode. */
-	cache_purge(vp);
-
-	/* Destroy the vm object and flush associated pages. */
-	vnode_destroy_vobject(vp);
-
 	/* Remove all the FID */
 	p9fs_fid_remove_all(np, FALSE);