summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-02-15 21:58:59 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-02-15 21:58:59 +0000
commit74d2cc667de43f5909ee5e5b434ace38b249a397 (patch)
tree97fc071e58cff14d7d79a8613eff7493efcdf4de
parent928d7c31618b48d77090f13e09595170b43ca95d (diff)
(diskfs_nput): It's not valid to touch *NP (by `mutex_unlock
(&np->lock);') after we have called diskfs_drop_node. So don't do it in that case.
-rw-r--r--libdiskfs/diskfs.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index c7a3c4a4..3f4690c5 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -616,10 +616,13 @@ diskfs_nput (struct node *np)
/* Now we can drop the reference back... */
goto loop;
}
+ mutex_unlock (&np->lock);
}
else
- spin_unlock (&diskfs_node_refcnt_lock);
- mutex_unlock (&np->lock);
+ {
+ spin_unlock (&diskfs_node_refcnt_lock);
+ mutex_unlock (&np->lock);
+ }
}
/* Release a hard reference on NP. If NP is locked by anyone, then