[PATCH v2] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread James Clarke
* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Fixed leaking iouser and peropen structs on error. --- libnetfs/trans-callback.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index 3f1aee6..ed21aa2

Re: [PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread Samuel Thibault
James Clarke, on Sun 07 Feb 2016 23:13:06 +, wrote: > > On 7 Feb 2016, at 23:10, Samuel Thibault wrote: > > Flávio Cruz, on Sun 07 Feb 2016 23:57:25 +0100, wrote: > >> Maybe here we should do it as follows: > >> > >> err = errno; > >> netfs_release_peropen (po); > >> iohelp_free_iouser (user)

Re: [PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread James Clarke
> On 7 Feb 2016, at 23:10, Samuel Thibault wrote: > Flávio Cruz, on Sun 07 Feb 2016 23:57:25 +0100, wrote: >> Maybe here we should do it as follows: >> >> err = errno; >> netfs_release_peropen (po); >> iohelp_free_iouser (user); >> return err; > > Yes, you never know what they could be doing to

Re: [PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread Samuel Thibault
Flávio Cruz, on Sun 07 Feb 2016 23:57:25 +0100, wrote: > Maybe here we should do it as follows: > > err = errno; > netfs_release_peropen (po); > iohelp_free_iouser (user); > return err; Yes, you never know what they could be doing to errno. Samuel

Re: [PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread Flávio Cruz
Thanks for noticing! > @@ -79,6 +82,7 @@ _netfs_translator_callback2_fn (void *cookie1, void > *cookie2, int flags, > } >else > { > + netfs_release_peropen (po); >iohelp_free_iouser (user); >return errno; > } Maybe here we should do it as follows: err =

[PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread James Clarke
* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Fixed leaking iouser and peropen structs on error. --- libnetfs/trans-callback.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index 3f1aee6..7816bd1 10064

Re: [PATCH] Check for a return value in netfs_make_peropen before using it in netfs_make_protid.

2016-02-07 Thread James Clarke
On 7 Feb 2016, at 14:51, Flavio Cruz wrote: > - cred = netfs_make_protid (netfs_make_peropen (node, flags, cookie2), > - user); > + po = netfs_make_peropen (node, flags, cookie2); > + if (! po) > +return errno; You need to free user. James signature.asc Descript

Re: [PATCH] Check for a return value in netfs_make_peropen before using it in netfs_make_protid.

2016-02-07 Thread Samuel Thibault
Flavio Cruz, on Sun 07 Feb 2016 09:51:24 -0500, wrote: > * libnetfs/trans-callback.c: Add check for netfs_make_peropen. pushed, thanks!

Re: [PATCH] Check for a return value in netfs_make_peropen before using it in netfs_make_protid.

2016-02-07 Thread Flavio Cruz
* libnetfs/trans-callback.c: Add check for netfs_make_peropen. --- libnetfs/trans-callback.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index f4f0c62..9ebe11c 100644 --- a/libnetfs/trans-callback.c +++ b/libnetf

Re: [PATCH] Check for a return value in netfs_make_peropen before using it in netfs_make_protid.

2016-02-07 Thread Samuel Thibault
Flavio Cruz, on Sun 07 Feb 2016 09:19:38 -0500, wrote: > + po = netfs_make_peropen (node, flags, cookie2); > + if (! po) > +return ENOMEM; I'd say rather return errno. Samuel

[PATCH] Check for a return value in netfs_make_peropen before using it in netfs_make_protid.

2016-02-07 Thread Flavio Cruz
* libnetfs/trans-callback.c: Add check. --- libnetfs/trans-callback.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index f4f0c62..9ebe11c 100644 --- a/libnetfs/trans-callback.c +++ b/libnetfs/trans-callback.c @@ -

[PATCH] Use libihash to store directory entries in ftpfs.

2016-02-07 Thread Flavio Cruz
* ftpfs/ftpfs.h: Add dir_locp for each directory entry and replace the table with a libihash table. * ftpfs/dir.c: Modify the code to use libihash. Remove several functions such as rehash and insert. --- ftpfs/dir.c | 142 -- ftpfs/ftpfs.

Re: [PATCH] Use refcount_t for peropen reference counting in libnetfs.

2016-02-07 Thread Justus Winter
Quoting Flavio Cruz (2016-02-07 07:33:00) > * libnetfs/netfs.h: Use refcount_t. > * libnetfs/make-peropen.c: Initialize to 1 with refcount_init just like in > libdiskfs. > * libnetfs/make-protid.c: Don't increment the count here. Do it like > libdiskfs. > * libnetfs/io-duplicate.c: Add refcount_r

Re: [PATCH] Remove libfshelp/trans.h and libfshelp/locks.h.

2016-02-07 Thread Justus Winter
Quoting Flavio Cruz (2016-02-07 08:04:34) > * libfshelp/locks.h: Remove. > * libfshelp/trans.h: Remove. struct transboot is not used anywhere. > * libfshelp/fetch-root.c: Adjust includes. > * libfshelp/lock-acquire.c: Likewise. > * libfshelp/lock-init.c: Likewise. Merged, thanks! Justus

[PATCH] Remove libfshelp/trans.h and libfshelp/locks.h.

2016-02-07 Thread Flavio Cruz
* libfshelp/locks.h: Remove. * libfshelp/trans.h: Remove. struct transboot is not used anywhere. * libfshelp/fetch-root.c: Adjust includes. * libfshelp/lock-acquire.c: Likewise. * libfshelp/lock-init.c: Likewise. --- libfshelp/fetch-root.c | 9 ++--- libfshelp/lock-acquire.c | 5 - lib

[PATCH] Use refcount_t for peropen reference counting in libnetfs.

2016-02-07 Thread Flavio Cruz
* libnetfs/netfs.h: Use refcount_t. * libnetfs/make-peropen.c: Initialize to 1 with refcount_init just like in libdiskfs. * libnetfs/make-protid.c: Don't increment the count here. Do it like libdiskfs. * libnetfs/io-duplicate.c: Add refcount_ref since netfs_make_protid no longer increments the re

[PATCH gnumach 1/3] vm: remove unused field from struct vm_external

2016-02-07 Thread Justus Winter
* vm/vm_external.h (struct vm_external): Remove unused field 'existence_count'. --- vm/vm_external.h | 5 + 1 file changed, 5 insertions(+) diff --git a/vm/vm_external.h b/vm/vm_external.h index 55c9e48..4e44ddf 100644 --- a/vm/vm_external.h +++ b/vm/vm_external.h @@ -46,9 +46,14 @@ typedef s

[PATCH gnumach 2/3] vm: allocate a large map for all objects larger than SMALL_SIZE

2016-02-07 Thread Justus Winter
* vm/vm_external.c (vm_external_create): Allocate a large map for all objects larger than SMALL_SIZE. 'vm_external_state_{g,s}et' can deal with offsets larger than 'LARGE_SIZE', so currently objects larger than 'LARGE_SIZE' are missing out on the optimization. --- vm/vm_external.c | 2 +- 1 file

[PATCH gnumach 3/3] vm: initialize external maps

2016-02-07 Thread Justus Winter
* vm/vm_external.c (vm_external_create): Initialize allocated maps. --- vm/vm_external.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vm/vm_external.c b/vm/vm_external.c index 7584a2b..6e71918 100644 --- a/vm/vm_external.c +++ b/vm/vm_external.c @@ -74,6 +74,7 @@ vm_external_t vm_external_c