summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-22 05:17:48 +0000
committerMiles Bader <miles@gnu.org>1997-02-22 05:17:48 +0000
commit21f9f4f0232cceded77f4a622580cce9daa19f98 (patch)
treed0ddfbbde0a744265de4e62182792a6ab29d996e /libdiskfs
parent84b890e949f89da5237ba62232998698406db450 (diff)
(diskfs_S_file_reparent):
Don't release a reference to any old shadow_root if it was == NODE. Don't aquire a new reference for NODE.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-reparent.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libdiskfs/file-reparent.c b/libdiskfs/file-reparent.c
index 83b4b309..bef01fac 100644
--- a/libdiskfs/file-reparent.c
+++ b/libdiskfs/file-reparent.c
@@ -43,7 +43,7 @@ diskfs_S_file_reparent (struct protid *cred, mach_port_t parent,
if (! err)
{
/* Remove old shadow root state. */
- if (new_cred->po->shadow_root)
+ if (new_cred->po->shadow_root && new_cred->po->shadow_root != node)
{
mutex_lock (&new_cred->po->shadow_root->lock);
diskfs_nput (new_cred->po->shadow_root);
@@ -53,7 +53,6 @@ diskfs_S_file_reparent (struct protid *cred, mach_port_t parent,
/* And install PARENT instead. */
new_cred->po->shadow_root = node;
- diskfs_nref (node);
new_cred->po->shadow_root_parent = parent;
*new = ports_get_right (new_cred);