Re: dlerror sets errno to ENOSYS

2016-03-06 Thread Samuel Thibault
Diego Nieto Cid, on Sun 06 Mar 2016 21:11:58 -0300, wrote: > The problem with the function as it is, is that by calling > cthread_getspecific it forces dlerror to clobber errno; and then the console > client is in trouble. > > May I do as below? > >void *val = NULL; >if ( _cthread_init_

refcounts assertion

2016-03-06 Thread Samuel Thibault
Hello, Some kind of refcount assertion failure we have been having is "refcount detected use-after-free!" from the call to refcounts_ref inside _ports_bucket_class_iterate, called for instance by the periodic sync. I'm thinking: what about this scenario: - thread A calls diskfs_nput() - that call

Re: dlerror sets errno to ENOSYS

2016-03-06 Thread Diego Nieto Cid
El 6 mar 2016, a las 20:07, Samuel Thibault escribió: > >__libc_getspecific is not a weak symbol, >keep it as it is, calling >cthread_getspecific. Oh, yes that's right. I didn't notice the attribute came from a Debian patch meant to be dropped. The problem with the function as it is, is tha

[PATCH] Remove global netfs lock and use hard and soft references for nodes.

2016-03-06 Thread Flavio Cruz
* libnetfs/drop-node.c: Remove use of netfs_node_refcnt_lock. * libnetfs/init-init.c: Remove netfs_node_refcnt_lock. * libnetfs/make-node.c: Initialize refcounts in refcounts_init. * libnetfs/netfs.h: Use refcounts_t for tracking node references. Remove netfs_node_refcnt_lock. Add netfs_nref_light,

Re: [PATCH] Correctly initialize prototype in itAlloc.

2016-03-06 Thread Samuel Thibault
Flavio Cruz, on Sun 06 Mar 2016 18:04:21 -0500, wrote: > * type.c (itAlloc): Initialize itKernelPort to FALSE. Oh, sure, applied :) Samuel

Re: dlerror sets errno to ENOSYS

2016-03-06 Thread Samuel Thibault
Diego Nieto Cid, on Sun 06 Mar 2016 22:56:15 -0300, wrote: > I had to add the first condition because otherwise a segmentation > fault was triggered. Ah, right. The rest of the code does that too. That's normal for an undefined symbol. > Finally, while this fixes the case where pthread is not p

[PATCH] Correctly initialize prototype in itAlloc.

2016-03-06 Thread Flavio Cruz
* type.c (itAlloc): Initialize itKernelPort to FALSE. --- type.c | 1 + 1 file changed, 1 insertion(+) diff --git a/type.c b/type.c index 4450b52..26a39b7 100644 --- a/type.c +++ b/type.c @@ -113,6 +113,7 @@ itAlloc(void) FALSE, /* boolean_t itString */ FALSE,

Re: [PATCH 1/8] libnetfs: remove global lock and use hard and soft references for netfs nodes. libnetfs translators can add soft references to nodes and then drop them using netfs_try_dropping_softref

2016-03-06 Thread Justus Winter
Hi Flavio, thank you so much for working on this. I have two nitpicks at this point, 1/ the subject line of this patch is way too long, it will look out of place in all the tools, and 2/ applying the first patch will break the build, and it will only compile again if the whole series is applied.

Re: dlerror sets errno to ENOSYS

2016-03-06 Thread Diego Nieto Cid
Hi The patch for thread-specific data key related functions is attached. As discussed on IRC, the modifications were extended to __libc_setspecific and __libc_getspecific. It has been generated with quilt against debian source package. On Sun, Feb 28, 2016 at 07:57:43PM +0100, Samuel Thibault wr

[PATCH 1/8] libnetfs: remove global lock and use hard and soft references for netfs nodes. libnetfs translators can add soft references to nodes and then drop them using netfs_try_dropping_softrefs.

2016-03-06 Thread Flavio Cruz
* libnetfs/drop-node.c: Remove use of netfs_node_refcnt_lock. * libnetfs/init-init.c: Remove netfs_node_refcnt_lock. * libnetfs/make-node.c: Initialize refcounts in refcounts_init. * libnetfs/netfs.h: Use refcounts_t for tracking node references. Remove netfs_node_refcnt_lock. Add netfs_nref_light,

[PATCH 8/8] console: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* console/console.c (netfs_node_norefs): Use a soft reference to store a node in dir_node, cons_node, disp_node, inp_node. * console/console.c (netfs_try_dropping_softrefs): When dropping all soft references remove node pointer from the fields above. --- console/console.c | 64

[PATCH 7/8] nfs: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* nfs/cache.c: Add mutex to handle exclusive access to nodehash. This replaces the use of netfs_node_refcnt_lock. * nfs/cache.c (lookup_handle): Use nodehash_ihash_lock when accessing nodehash. Use netfs_nref_light to add one soft reference to the node just added to nodehash. * nfs/cache.c (netfs_n

[PATCH 6/8] procfs: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* procfs/netfs.c: Remove use of netfs_node_refcnt_lock. --- procfs/netfs.c | 4 1 file changed, 4 deletions(-) diff --git a/procfs/netfs.c b/procfs/netfs.c index 276c57c..0b3d31a 100644 --- a/procfs/netfs.c +++ b/procfs/netfs.c @@ -222,12 +222,8 @@ error_t netfs_attempt_lookup (struct iouser

[PATCH 3/8] usermux: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* usermux/mux.c: Use netfs_nref to increase hard references of the node. --- usermux/mux.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usermux/mux.c b/usermux/mux.c index bfa95fd..7c57f94 100644 --- a/usermux/mux.c +++ b/usermux/mux.c @@ -298,10 +298,8 @@ lookup_cache

[PATCH 5/8] trans: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* trans/fakeroot.c (new_node): Use a light reference when storing a node in the hash table. * trans/fakeroot.c (netfs_try_dropping_softrefs): Implement netfs_try_dropping_softrefs to remove the node from the hash table. * trans/fakeroot.c (netfs_node_norefs): Remove code to remove the node from the

[PATCH 4/8] hostmux: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* hostmux/mux.c: Use netfs_nref to increase hard references of the node. --- hostmux/mux.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hostmux/mux.c b/hostmux/mux.c index 81d3961..ddca89d 100644 --- a/hostmux/mux.c +++ b/hostmux/mux.c @@ -240,10 +240,8 @@ lookup_cache

[PATCH 2/8] ftpfs: Use refcounts_t to track node references.

2016-03-06 Thread Flavio Cruz
* ftpfs/dir.c: Use netfs_nref without locking the old netfs_node_refcnt_lock. * ftpfs/node.c: Likewise. --- ftpfs/dir.c | 27 ++- ftpfs/node.c | 8 +--- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/ftpfs/dir.c b/ftpfs/dir.c index 733a2dc..2ea29b5 10