[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 72/98: trans: fix reference counting bug in fakeroot
From: |
Samuel Thibault |
Subject: |
[hurd] 72/98: trans: fix reference counting bug in fakeroot |
Date: |
Tue, 14 Jan 2014 02:00:03 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 7d20408ec4a5dbc973520dd78dd2531c6a1471c7
Author: Justus Winter <address@hidden>
Date: Thu Dec 5 23:38:53 2013 +0100
trans: fix reference counting bug in fakeroot
The function new_node creates virtual nodes using netfs_make_node.
Nodes created with netfs_make_node already have a reference count of
one. Currently another reference is added in new_node. This prevents
the destruction of the node causing bugs like this:
% fakeroot-hurd sh -c 'l(){ flock /tmp/$$.lock true; }; l; l'
<hangs>
* trans/fakeroot.c (new_node): Fix reference count of newly created
nodes.
---
trans/fakeroot.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index d5cb0e6..5c4854d 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -108,10 +108,7 @@ new_node (file_t file, mach_port_t idport, int locked, int
openmodes,
pthread_mutex_lock (&idport_ihash_lock);
err = hurd_ihash_add (&idport_ihash, nn->idport, nn);
if (!err)
- {
- pthread_mutex_lock (&(*np)->lock);
- netfs_nref (*np); /* Return a reference to the caller. */
- }
+ pthread_mutex_lock (&(*np)->lock);
pthread_mutex_unlock (&idport_ihash_lock);
}
if (err)
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 65/98: trans: fix the use of the hash table in fakeroot.c, (continued)
- [hurd] 65/98: trans: fix the use of the hash table in fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 37/98: libshouldbeinlibc: fix minor port leak in maptime_map, Samuel Thibault, 2014/01/13
- [hurd] 38/98: init: fix port leak, Samuel Thibault, 2014/01/13
- [hurd] 68/98: trans: fix locking issue in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 55/98: pflocal: improve the demuxer functions, Samuel Thibault, 2014/01/13
- [hurd] 57/98: utils: improve the auth_demuxer function in fakeauth.c, Samuel Thibault, 2014/01/13
- [hurd] 66/98: trans: improve the performance of dir_lookup in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 41/98: libports: improve error handling in ports_reallocate_from_external, Samuel Thibault, 2014/01/13
- [hurd] 40/98: libports: improve error handling in ports_reallocate_port, Samuel Thibault, 2014/01/13
- [hurd] 58/98: trans: remove unused declaration from fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 72/98: trans: fix reference counting bug in fakeroot,
Samuel Thibault <=
- [hurd] 39/98: proc: update comments, Samuel Thibault, 2014/01/13
- [hurd] 26/98: Make sure created netfs nodes have stat validated, Samuel Thibault, 2014/01/13
- [hurd] 53/98: proc: improve the message_demuxer function, Samuel Thibault, 2014/01/13
- [hurd] 04/98: utils: implement settrans --pid-file, Samuel Thibault, 2014/01/13
- [hurd] 59/98: trans: improve the netfs_demuxer function in fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 48/98: libports: another right leak fix, Samuel Thibault, 2014/01/13
- [hurd] 73/98: trans: improve the error handling in fakeauth, Samuel Thibault, 2014/01/13
- [hurd] 06/98: proc: fix the declaraton of genpid, Samuel Thibault, 2014/01/13
- [hurd] 71/98: trans: fix locking in fakeroot's netfs_S_dir_lookup, Samuel Thibault, 2014/01/13
- [hurd] 70/98: trans: fix reference counting and destruction of fake nodes, Samuel Thibault, 2014/01/13