[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/13] trans: fix reference counting bug in fakeroot
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 10/13] trans: fix reference counting bug in fakeroot |
Date: |
Tue, 10 Dec 2013 01:12:31 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Mon 09 Dec 2013 15:16:38 +0100, a écrit :
> 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:
Ack.
> % 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)
> --
> 1.7.10.4
>
--
Samuel
Running Windows on a Pentium is like having a brand new Porsche but only
be able to drive backwards with the handbrake on.
(Unknown source)
- Re: [PATCH 08/13] trans: fix reference counting and destruction of fake nodes, (continued)
- [PATCH 11/13] trans: improve the error handling in fakeauth, Justus Winter, 2013/12/09
- [PATCH 09/13] trans: fix locking in fakeroot's netfs_S_dir_lookup, Justus Winter, 2013/12/09
- [PATCH 12/13] trans: unlock nodes with faked attributes in fakeroot, Justus Winter, 2013/12/09
- [PATCH 05/13] trans: handle invalid responses to dir_lookup requests in fakeroot, Justus Winter, 2013/12/09
- [PATCH 10/13] trans: fix reference counting bug in fakeroot, Justus Winter, 2013/12/09
- Re: [PATCH 10/13] trans: fix reference counting bug in fakeroot,
Samuel Thibault <=
- [PATCH 13/13] console-client: remove spurious pthread_spin_unlocks, Justus Winter, 2013/12/09
- Re: More fixes for fakeroot-hurd, Samuel Thibault, 2013/12/09
- [PATCH 1/5] utils/settrans: fix the teardown of chrooted environments, Justus Winter, 2013/12/10