Page MenuHomeFreeBSD

D58632.1795145938.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D58632.1795145938.diff

diff --git a/sys/fs/p9fs/p9fs_vfsops.c b/sys/fs/p9fs/p9fs_vfsops.c
--- a/sys/fs/p9fs/p9fs_vfsops.c
+++ b/sys/fs/p9fs/p9fs_vfsops.c
@@ -263,7 +263,7 @@
struct p9fs_node *node;
struct thread *td;
uint32_t hash;
- int error, error_reload = 0;
+ int error;
struct p9fs_inode *inode;
td = curthread;
@@ -352,57 +352,31 @@
if (vp->v_type != VFIFO)
VN_LOCK_ASHARE(vp);
error = insmntque(vp, mp);
- if (error != 0) {
- /*
- * vput(vp) is already called from insmntque_stddtr().
- * Just goto 'out' to dispose the node.
- */
- goto out;
- }
+ if (error != 0)
+ return (error);
/* Init the vnode with the disk info*/
error = p9fs_reload_stats_dotl(vp, curthread->td_ucred);
if (error != 0) {
- error_reload = 1;
- goto out;
+ P9FS_NODE_SETF(np, P9FS_NODE_DELETED);
+ vgone(vp);
+ vput(vp);
+ return (error);
}
error = vfs_hash_insert(vp, hash, flags, td, vpp,
p9fs_node_cmp, &fid->qid);
- if (error != 0) {
- goto out;
- }
+ if (error != 0 || *vpp != NULL)
+ return (error);
- if (*vpp == NULL) {
- P9FS_LOCK(vses);
- STAILQ_INSERT_TAIL(&vses->virt_node_list, np, p9fs_node_next);
- P9FS_NODE_SETF(np, P9FS_NODE_IN_SESSION);
- P9FS_UNLOCK(vses);
- vn_set_state(vp, VSTATE_CONSTRUCTED);
- *vpp = vp;
- } else {
- /*
- * Returning matching vp found in hashlist.
- * So cleanup the np allocated above in this context.
- */
- if (!IS_ROOT(np)) {
- p9fs_destroy_node(&np);
- }
- }
+ P9FS_LOCK(vses);
+ STAILQ_INSERT_TAIL(&vses->virt_node_list, np, p9fs_node_next);
+ P9FS_NODE_SETF(np, P9FS_NODE_IN_SESSION);
+ P9FS_UNLOCK(vses);
+ vn_set_state(vp, VSTATE_CONSTRUCTED);
+ *vpp = vp;
return (0);
-out:
- /* Something went wrong, dispose the node */
- if (!IS_ROOT(np)) {
- p9fs_destroy_node(&np);
- }
-
- if (error_reload) {
- vput(vp);
- }
-
- *vpp = NULL;
- return (error);
}
/* Main mount function for 9pfs */
diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c
--- a/sys/fs/p9fs/p9fs_vnops.c
+++ b/sys/fs/p9fs/p9fs_vnops.c
@@ -115,9 +115,6 @@
if ((np->flags & P9FS_NODE_IN_SESSION) != 0) {
P9FS_NODE_CLRF(np, P9FS_NODE_IN_SESSION);
STAILQ_REMOVE(&vses->virt_node_list, np, p9fs_node, p9fs_node_next);
- } else {
- P9FS_UNLOCK(vses);
- return;
}
P9FS_UNLOCK(vses);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 20, 3:38 AM (25 m, 12 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41858921
Default Alt Text
D58632.1795145938.diff (2 KB)

Event Timeline