[PATCH 3/7] hurd: add notification callbacks for the process management

2013-09-16 Thread Justus Winter
XXX * hurd/process_notify.defs: New file. --- hurd/process_notify.defs | 21 + 1 file changed, 21 insertions(+) create mode 100644 hurd/process_notify.defs diff --git a/hurd/process_notify.defs b/hurd/process_notify.defs new file mode 100644 index 000..7972ef7 --- /dev

[PATCH] kern: new task notifications

2013-09-16 Thread Justus Winter
* Makefrag.am: Add task_notify.defs. * include/mach/gnumach.defs: Add register_new_task_notification. * include/mach/task_notify.defs: New file. * kern/task.c (new_task_notification): New variable. (task_create): Send new task notifications. (register_new_task_notification): Add server function. *

Split /hurd/init into two programs (was: upstream GNU Hurd vs Debian GNU Hurd?)

2013-09-16 Thread Justus Winter
Hi :) ok, getting back on topic: Quoting Thomas Schwinge (2013-09-10 20:36:42) > > /hurd/init is not an init system, it barely does anything any other > > init system does. From my point of view its name is the only thing > > that it has in common with other init systems, and it should really be

Re: cgroupfs, /hurd/proc and subhurds

2013-09-17 Thread Justus Winter
Quoting Ludovic =?utf-8?Q?Court=C3=A8s?= (2013-09-17 13:47:23) > Hi! > > Justus Winter <4win...@informatik.uni-hamburg.de> skribis: > > > Linux has this feature called cgroups. It groups processes (threads) > > together in groups, furthermore so called controllers c

Re: [PATCH 10/16] hurd: add fsys_get_children

2013-09-19 Thread Justus Winter
Quoting David Michael (2013-09-17 18:43:24) > Hi, > > On Tue, Jul 30, 2013 at 5:59 AM, Justus Winter > <4win...@informatik.uni-hamburg.de> wrote: > > * hurd/fsys.defs: Add fsys_get_children. > > * hurd/fsys_reply.defs: Add fsys_get_children. > > While tryi

[PATCH 3/5] sutils: set up /dev/null using /bin/nullpriv in MAKEDEV.sh

2013-09-19 Thread Justus Winter
This patch makes MAKEDEV.sh use the /bin/nullpriv wrapper so that the storeio translator serving /dev/null is started without any unix privileges. * sutils/MAKEDEV.sh (mkdev): Use /bin/nullpriv for /dev/null. --- sutils/MAKEDEV.sh |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 2/5] daemons: make sure /proc is properly set up

2013-09-19 Thread Justus Winter
This patch makes runsystem.sh check whether /proc is set up and does so using settrans -c if it is not. * daemons/runsystem.sh: Make sure /proc is set up. --- daemons/runsystem.sh |8 1 file changed, 8 insertions(+) diff --git a/daemons/runsystem.sh b/daemons/runsystem.sh index f4f2

[PATCH 1/5] daemons: make sure / is writable before setting up pflocal

2013-09-19 Thread Justus Winter
runsystem.sh checks whether /servers/socket/1 exists and creates it using settrans -c if it does not. But at this point in the boot the root filesystem is normally not writable. This patch fixes this. * daemons/runsystem.sh: Make sure / is writable before attempting to set up pflocal. --- daemo

[PATCH 5/5] hurd: add _reply suffix to the routines in fsys_reply.defs

2013-09-19 Thread Justus Winter
* hurd/fsys_reply.defs: Add _reply suffix. --- hurd/fsys_reply.defs |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hurd/fsys_reply.defs b/hurd/fsys_reply.defs index 2f5b035..89fb3a4 100644 --- a/hurd/fsys_reply.defs +++ b/hurd/fsys_reply.defs @@ -77,12 +77,12 @@ simpler

[PATCH 4/5] hurd: add _reply suffix to the routines in process_reply.defs

2013-09-19 Thread Justus Winter
* hurd/process_reply.defs: Add _reply suffix. --- hurd/process_reply.defs | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/hurd/process_reply.defs b/hurd/process_reply.defs index 66a7551..ed46d55 100644 --- a/hurd/process_reply.defs

Re: [PATCH 2/5] daemons: make sure /proc is properly set up

2013-09-19 Thread Justus Winter
Quoting Ludovic =?utf-8?Q?Court=C3=A8s?= (2013-09-19 12:19:00) > Justus Winter <4win...@informatik.uni-hamburg.de> skribis: > > > This patch makes runsystem.sh check whether /proc is set up and does > > so using settrans -c if it is not. > > I think this should be

[PATCH 1/9] Add proc_set_init_task, make runsystem pid 1

2013-09-23 Thread Justus Winter
* hurd/process.defs (proc_set_init_task): New procedure. * hurd/process_reply.defs (proc_set_init_task): Likewise. * hurd/process_request.defs (proc_set_init_task): Likewise. * include/pids.h: Add HURD_PID_INIT as 1, adjust others accordingly. * init/init.c (start_child): Register the child task. *

POC: split init into /hurd/startup and /hurd/init

2013-09-23 Thread Justus Winter
Hi, this is my proof of concept patch series splitting /hurd/init into /hurd/startup and /hurd/init. [PATCH 1/9] Add proc_set_init_task, make runsystem pid 1 Unchanged, just rebased to master. [PATCH 2/9] startup: rename init to startup [PATCH 3/9] Add a minimalist init program The new /hurd/i

[PATCH 4/9] startup: do not pass signals on to the child

2013-09-23 Thread Justus Winter
Formerly /hurd/startup would forward all signals to the child it started (e.g. /libexec/runsystem). The motivation for doing so is not revealed in the comments, nor it is mentioned in the history of the version control system. This patch removes the forwarding of signals to the child. * startup/

[PATCH 3/9] Add a minimalist init program

2013-09-23 Thread Justus Winter
--- init/Makefile | 24 + init/init.c | 152 + 2 files changed, 176 insertions(+) create mode 100644 init/Makefile create mode 100644 init/init.c diff --git a/init/Makefile b/init/Makefile new file mode 100644 index 000..0

[PATCH 8/9] poc /servers/startup

2013-09-23 Thread Justus Winter
--- startup/Makefile |2 +- startup/startup.c | 124 + 2 files changed, 125 insertions(+), 1 deletion(-) diff --git a/startup/Makefile b/startup/Makefile index 277fee4..23d35cb 100644 --- a/startup/Makefile +++ b/startup/Makefile @@ -21,7

[PATCH 7/9] startup: fix the declaration of the *_server functions

2013-09-23 Thread Justus Winter
* startup/startup.c (demuxer): Fix the declaration of the server functions. --- startup/startup.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/startup/startup.c b/startup/startup.c index b872188..fd5f1c2 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -412,7

[PATCH 5/9] startup: remove unused function run_for_real

2013-09-23 Thread Justus Winter
* startup/startup.c (run_for_real): Remove function. --- startup/startup.c | 89 - 1 file changed, 89 deletions(-) diff --git a/startup/startup.c b/startup/startup.c index f54e650..a569fe2 100644 --- a/startup/startup.c +++ b/startup/startup.c

[PATCH 6/9] startup: be more specific in the shutdown message

2013-09-23 Thread Justus Winter
Use the BOOT macro to print either halt or reboot instead of the generic shutdown in the event of an system shutdown. * startup/startup.c (reboot_system): Use more specific message. --- startup/startup.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup/startup.c b/st

[PATCH 9/9] XXX fix build

2013-09-23 Thread Justus Winter
--- exec/Makefile|2 +- ext2fs/Makefile |3 ++- startup/Makefile |2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/exec/Makefile b/exec/Makefile index 890ee4b..f975632 100644 --- a/exec/Makefile +++ b/exec/Makefile @@ -22,7 +22,7 @@ makemode := server SRCS =

[PATCH 3/3] libfshelp: properly free active translator entries

2013-10-08 Thread Justus Winter
Previously the dynamically allocated field name leaks. Fix this by properly freeing the objects of type struct translator. * libfshelp/translator-list.c (translator_ihash_cleanup): Fix memory leak. --- libfshelp/translator-list.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH 1/3] Revert "tmpfs: drop privileges in the tmpfs translator"

2013-10-08 Thread Justus Winter
This reverts commit 7075bc11289355478659cd1610632a9299734afc. Dropping the unix privileges of the tmpfs translator causes problems with the passive translator startup. The function fshelp_fetch_root creates an auth handle containing the processes original UID and GID. But if the privileges were dr

[PATCH 2/3] trans: rename a global variable

2013-10-08 Thread Justus Winter
Rename the global variable "path" to "target_path" to make it more unambiguous. * trans/mtab.c: Rename global variable "path". --- trans/mtab.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/trans/mtab.c b/trans/mtab.c index 2973a0b..250de7d 100644 --- a/tr

[PATCH 3/5] console-client: replace function epilogue with console_exit

2013-10-10 Thread Justus Winter
* console-client/console.c (main): Replace epilogue with console_exit. --- console-client/console.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/console-client/console.c b/console-client/console.c index a9f8368..4046cf3 100644 --- a/console-client/console.c +++ b/consol

[PATCH 1/5] console-client: remove the pid file on clean exits

2013-10-10 Thread Justus Winter
Remove the pid file if the console client exits either cleanly using console_exit or because of an error during daemonization. * console-client/console.c (console_exit): Remove the pid file. (daemon_error): Likewise. --- console-client/console.c |5 + 1 file changed, 5 insertions(+) diff

[PATCH 2/5] console-client: entitle console_exit with the noreturn attribute

2013-10-10 Thread Justus Winter
* console-client/input.h (console_exit): Add noreturn attribute. --- console-client/input.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console-client/input.h b/console-client/input.h index 351fa34..61deadc 100644 --- a/console-client/input.h +++ b/console-client/input.h

[PATCH 4/5] console-client: minor stylistic fix

2013-10-10 Thread Justus Winter
* console-client/console.c (main): Minor stylistic fix. --- console-client/console.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console-client/console.c b/console-client/console.c index 4046cf3..a105f5e 100644 --- a/console-client/console.c +++ b/console-client/console.

[PATCH 5/5] console-client: fix error handling

2013-10-10 Thread Justus Winter
Fix the error handling in console_move_mouse. This also appeases the compiler. * console-client/console.c (console_move_mouse): Fix error handing. --- console-client/console.c |1 + 1 file changed, 1 insertion(+) diff --git a/console-client/console.c b/console-client/console.c index a105f5e.

Re: [PATCH 3/5] console-client: replace function epilogue with console_exit

2013-10-10 Thread Justus Winter
Quoting Neal H. Walfield (2013-10-10 19:24:32) > At Thu, 10 Oct 2013 18:08:20 +0200, > Justus Winter wrote: > > > > * console-client/console.c (main): Replace epilogue with console_exit. > > --- > > console-client/console.c |3 +-- > > 1 file

POSIX file system test suite for Hurd translators

2013-10-11 Thread Justus Winter
Hi :) I ported Pawel Jakub Dawidek's POSIX file system test suite to the Hurd: https://teythoon.cryptobitch.de/fstest/ The code can be found here: http://darnassus.sceen.net/gitweb/teythoon/fstest.git/ I haven't looked closely at any failures yet, but if the results have any relation to the qu

Debian/Hurd d-i installation report

2013-10-22 Thread Justus Winter
Hi, I just installed Debian/Hurd using d-i [0] on a VIA Eden mini-ITX mainboard [1]. I just used the first cd for the installation, no network mirror. All in all it went fine, some remarks: * No passive translator was installed on /proc. * The tasksel step looked strange, there was just one empt

Re: Debian/Hurd d-i installation report

2013-10-22 Thread Justus Winter
Quoting Samuel Thibault (2013-10-22 15:12:12) > > * I installed a 250GB hard disk but it doesn't show up with the full > > capacity, dunno why. > > If you installed through IDE, that's expected: Linux drivers in Mach > support LBA28 only, which is 128GiB. Ok, thanks for clarifying that. Is ther

llvm / clang / scan-build of the Hurd

2013-10-22 Thread Justus Winter
Hi :) I've been playing with the Clang Static Analyzer. I noticed that while clang does not work, scan-build does (see below): % cat test.c int main() { return 0; } % clang -v test.c Debian clang version 3.2-11 (tags/RELEASE_32/final) (based on LLVM 3.2) Target: i386-pc--gnu Thread model: posix

Re: Debian/Hurd d-i installation report

2013-10-22 Thread Justus Winter
Hi :) Quoting Justus Winter (2013-10-22 14:59:06) > I just installed Debian/Hurd using d-i [0] on a VIA Eden mini-ITX > mainboard [1]. I just used the first cd for the installation, no > network mirror. All in all it went fine, some remarks: * d-i confuses the cdrom drive for a hard

Re: Debian/Hurd d-i installation report

2013-10-22 Thread Justus Winter
Quoting Samuel Thibault (2013-10-22 17:46:40) > > * the cdrom entry in /etc/fstab has "iso9660fs" as filesystem > > type. While our mount should cope with this just fine, this clearly > > deviates both from the Linux version and the ext2 entries that just > > read "ext2". > > Indeed, I have

Re: Debian/Hurd d-i installation report

2013-10-22 Thread Justus Winter
Quoting Samuel Thibault (2013-10-22 17:58:01) > Justus Winter, le Tue 22 Oct 2013 17:53:04 +0200, a écrit : > > Quoting Samuel Thibault (2013-10-22 17:46:40) > > > > * the cdrom entry in /etc/fstab has "iso9660fs" as filesystem > > > > type. While our

[PATCH 4/5] libshouldbeinlibc: fix error handling in maptime_map

2013-10-25 Thread Justus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/maptime.c (maptime_map): Fix error handling. --- libshouldbeinlibc/maptime.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c index bc75045..cacf4b6 100644 --- a/libshouldb

[PATCH 2/5] exec: Remove the remaining BFD related bits

2013-10-25 Thread Justus Winter
* exec/Makefile: Remove commented out lines related to BFD. * exec/hostarch.c: Remove all BFD related code. * exec/main.c: Likewise. --- exec/Makefile |3 -- exec/hostarch.c | 99 +-- exec/main.c | 19 --- 3 files changed, 1

[PATCH 3/5] libports: fix error handling in _ports_create_port_internal

2013-10-25 Thread Justus Winter
Previously any err value set before reaching lose: was overwritten and thus not properly propagated. Found using the Clang Static Analyzer. * libports/create-internal.c (_ports_create_port_internal): Fix error handling. --- libports/create-internal.c |7 --- 1 file changed, 4 insertion

[PATCH 5/5] libtrivfs: fix an use-after-free error

2013-10-25 Thread Justus Winter
Found using the Clang Static Analyzer. * libtrivfs/protid-clean.c (trivfs_clean_protid): Fix use-after-free error. --- libtrivfs/protid-clean.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtrivfs/protid-clean.c b/libtrivfs/protid-clean.c index 856d7af..575dec3 100

[PATCH 1/5] Makeconf: add -fno-strict-aliasing to CFLAGS

2013-10-25 Thread Justus Winter
If gcc is used with optimizations -O2, -O3, or -Os, it will enable optimizations that assume that pointers of different type do not alias, i.e. point to the same address. However, we use this a lot, e.g. in code using libports. Add -fno-strict-aliasing to CFLAGS to disable optimizations based on t

[PATCH] configure.ac: properly escape the test for X11/keysymdef.h

2013-10-25 Thread Justus Winter
* configure.ac: Properly escape the test for X11/keysymdef.h using AC_LANG_SOURCE. --- configure.ac |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6844f6c..d822dd2 100644 --- a/configure.ac +++ b/configure.ac @@ -259,7 +259,7 @@ PKG_CHECK

Re: [PATCH 3/5] libports: fix error handling in _ports_create_port_internal

2013-10-25 Thread Justus Winter
Quoting Thomas Schwinge (2013-10-25 15:27:10) > > --- a/libports/create-internal.c > > +++ b/libports/create-internal.c > > @@ -109,10 +109,11 @@ _ports_create_port_internal (struct port_class *class, > >err = EINTR; > > lose: > >pthread_mutex_unlock (&_ports_lock); > > + error_t e; > >

More static analysis reports (was: llvm / clang / scan-build of the Hurd)

2013-11-02 Thread Justus Winter
Quoting Thomas Schwinge (2013-10-25 15:48:06) > > > The static analyzer is good at spotting errors, see [0] for a partial > > > build of the Hurd using scan-build. > > > > They seem worth having a look at indeed. > > Absolutely! As well as... obviously... dare I say it: GCC compiler > warnings.

[PATCH 2/2] kern: fix the error handling in exec_load

2013-11-04 Thread Justus Winter
Found using the Clang Static Analyzer. * kern/elf-load.c (exec_load): Properly propagate errors. --- kern/elf-load.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/kern/elf-load.c b/kern/elf-load.c index 1d103d3..441276e 100644 --- a/kern/elf-load.c +++ b/kern/elf-load.c @@ -80,6 +80,8

[PATCH 1/2] device: fix enqueuing of characters in ttyinput_many

2013-11-04 Thread Justus Winter
Fix enqueuing of characters in ttyinput_many by wrapping the call to b_to_q in a loop. This was probably intended by the authors, as they subtract the number of enqueued characters from count. Found using the Clang Static Analyzer. * device/chario.c (ttyinput_many): Fix enqueuing of characters. -

[PATCH 1/3] libshouldbeinlibc: fix reference counting in port_name_xlator_create

2013-11-07 Thread Justus Winter
Both task ports are deallocated in the destructor, so they must be referenced in the constructor. * libshouldbeinlibc/portxlate.c (port_name_xlator_create): Fix reference counting. --- libshouldbeinlibc/portxlate.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libshouldbeinlibc/portx

[PATCH 2/3] utils: implement portinfo --search

2013-11-07 Thread Justus Winter
Implement the --search switch of portinfo. The feature was suggested in the source code and partly implemented. portinfo --search locates the target ports (or all ports) in any other process and prints the port mapping and information about the port in the remote process. * utils/Makefile: Link po

[PATCH 3/3] utils: implement settrans --pid-file

2013-11-07 Thread Justus Winter
This switch makes settrans write the pid file of the active translator it starts to a file. This makes the pid easily retrievable for test suites. * utils/settrans.c (options): Add --pid-file. (main): Add variable pid_file. (parse_opt): Handle --pid-file switch. (open_node): Write pid file. --- u

[PATCH 07/14] proc: fix the declaraton of genpid

2013-11-08 Thread Justus Winter
* proc/proc.h (genpid): Fix declaration. --- proc/proc.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc/proc.h b/proc/proc.h index 5615f77..dcfc0db 100644 --- a/proc/proc.h +++ b/proc/proc.h @@ -164,7 +164,7 @@ void prociterate (void (*)(struct proc *, void *), void *)

[PATCH 11/14] auth: fix use of uninitialized variable err

2013-11-08 Thread Justus Winter
Previously a plausible execution path existed so the value of err was undefined at the end of the function, making the function return arbitrary error values. Fix this by initializing it to 0. Found using the Clang Static Analyzer. * auth/auth.c (S_auth_server_authenticate): Initialize err to 0.

[PATCH 10/14] init: fix memory leak

2013-11-08 Thread Justus Winter
Found using the Clang Static Analyzer. * init/init.c (process_signal): Fix memory leak. --- init/init.c |1 + 1 file changed, 1 insertion(+) diff --git a/init/init.c b/init/init.c index 94f1a9b..de5dd6b 100644 --- a/init/init.c +++ b/init/init.c @@ -961,6 +961,7 @@ process_signal (int signo)

[PATCH 14/14] mach-defpager: remove unused variables

2013-11-08 Thread Justus Winter
Found using the Clang Static Analyzer. * mach-defpager/default_pager.c (seqnos_memory_object_terminate): Remove unused variables request_refs and name_refs. --- mach-defpager/default_pager.c |3 --- 1 file changed, 3 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/d

[PATCH 09/14] proc: fix error handling in S_proc_exception_raise

2013-11-08 Thread Justus Winter
Found using the Clang Static Analyzer. * proc/mgt.c (S_proc_exception_raise): Fix error propagation. --- proc/mgt.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/proc/mgt.c b/proc/mgt.c index 4da2216..ad6355d 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -458,6 +458,8 @@ S_proc_exception

[PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions

2013-11-08 Thread Justus Winter
rebuild_uname uses {init,add}str to incrementally build a version string, and compare_versions to sort the versions array. Previously those functions were defined as nested functions. This commit turns them into normal functions prefixed with ru_, and also adds ru_finalizestr. ru_*str use two glob

[PATCH 04/14] proc: turn count_up and store_pid into normal functions

2013-11-08 Thread Justus Winter
Previously count_up and store_pid were defined inside S_proc_getallpids. Move them out of that function and declare them static. * proc/mgt.c: Turn count_up and store_pid into normal functions. --- proc/mgt.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff

[PATCH 03/14] proc: remove declaration of nested functions from proc.h

2013-11-08 Thread Justus Winter
Remove the declaration of count_up and strore_pid from proc.h. The functions are defined as nested functions in S_proc_getallpids, there is no need to declare them. Furthermore, the declaration does not match the definition. * proc/proc.h: Remove declaration of count_up and strore_pid. --- proc/p

[PATCH 05/14] proc: turn reap into a normal function

2013-11-08 Thread Justus Winter
Previously reap was a nested function defined inside of S_proc_wait. * proc/wait.c: Turn reap into a normal function. --- proc/wait.c | 45 ++--- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/proc/wait.c b/proc/wait.c index 824e667..f70d

[PATCH 01/14] term: fix error handling in hurdio_mdmctl

2013-11-08 Thread Justus Winter
hurdio_mdmctl allows one to set and clear bits from the modem control bit vector. However, plausible code paths exist that leave oldbits uninitialized. Fix this by returning an error instead if retrieving the oldbits failed and the bit set or clear operation was selected. Found using the Clang Sta

[PATCH 08/14] proc: fix a use-after-free error

2013-11-08 Thread Justus Winter
If we have to create a new process group, we have to do this before leaving the current one. The current process group is deallocated if the process is the last process in that group. Likewise, if the current group was the last group in the current groups session, the session is deallocated. Found

[PATCH 02/14] libtrivfs: improve the out of memory handling in add_el

2013-11-08 Thread Justus Winter
add_el reallocs two memory regions. If at least one of the operation fails, free any region that was successfully resized. Also release the lock. Found using the Clang Static Analyzer. * libtrivfs/dyn-classes.c (add_el): Improve the oom handling. --- libtrivfs/dyn-classes.c |3 +++ 1 file ch

[PATCH 13/14] mach-defpager: include errno.h

2013-11-08 Thread Justus Winter
Define _GNU_SOURCE and include errno.h so that the type error_t is defined. * mach-defpager/default_pager.c: Define _GNU_SOURCE and include errno.h. --- mach-defpager/default_pager.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pa

[PATCH 12/14] mach-defpager: turn dealloc_direct into a normal function

2013-11-08 Thread Justus Winter
* mach-defpager/default_pager.c (dealloc_direct): Move function definition outside of pager_truncate. --- mach-defpager/default_pager.c | 45 + 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/

Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions

2013-11-09 Thread Justus Winter
Quoting Ludovic =?utf-8?Q?Court=C3=A8s?= (2013-11-09 00:31:08) > Justus Winter <4win...@informatik.uni-hamburg.de> skribis: > > > rebuild_uname uses {init,add}str to incrementally build a version > > string, and compare_versions to sort the versions array. Previously

Re: [PATCH] Normalize whitespace at the end of each file to '\n'

2013-11-09 Thread Justus Winter
Quoting Samuel Thibault (2013-11-08 23:38:33) > Why not, it does not hurt. Except perhaps these, do we really need to > put a blank line there? Having then really 0-long avoids allocating any > data block at all, just metadata. > > > diff --git a/pfinet/glue-include/asm/segment.h > > b/pfinet/g

Re: [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions

2013-11-09 Thread Justus Winter
Hi :) Quoting Richard Braun (2013-11-09 14:00:35) > On Sat, Nov 09, 2013 at 11:08:28AM +0100, Justus Winter wrote: > > Quoting Ludovic =?utf-8?Q?Court=C3=A8s?= (2013-11-09 00:31:08) > > > Justus Winter <4win...@informatik.uni-hamburg.de> skribis: > > > > >

[PATCH] libports: fix the thread counts in case the thread creation fails

2013-11-09 Thread Justus Winter
Previously the number of total threads and the number of unused threads was wrong if at one point the creation of a thread failed. Fix this by decrementing both counters that were previously optimistically incremented. Adjust the comment accordingly. * libports/manage-multithread.c (ports_manage_p

Re: [PATCH 3/5] kern: eliminate unused assignment

2013-11-10 Thread Justus Winter
Quoting Samuel Thibault (2013-11-10 23:04:28) > Marin Ramesa, le Sun 10 Nov 2013 22:50:22 +0100, a écrit : > > Value of result is never read. Eliminate the unused assignment. > > > > * kern/elf-load.c: Eliminate unused assignment. > > Justus has an ACKed better patch which propagates the result,

[PATCH] libports: implement lockless management of threads

2013-11-11 Thread Justus Winter
ports_manage_port_operations_multithread uses two values, totalthreads and nreqthreads, to manage the threads it creates. Previously the two values were stored in two variables and a lock was used to synchronize the access to them. Use a single variable thread_counts to hold both values. This way

lockless thread management in libports (was: [PATCH] libports: fix the thread counts in case the thread creation fails)

2013-11-11 Thread Justus Winter
Hi :) > > > It might be a good idea use atomic operations instead of the spin lock > > > (which is what the spin lock is using behind the scenes anyways). > > > > It may not be possible: further down there is a decision taken depending > > on totalthreads/nreqthreads becoming 1, and thus you need

Re: [PATCH] libports: implement lockless management of threads

2013-11-12 Thread Justus Winter
Quoting Neal H. Walfield (2013-11-11 22:02:46) > Yes, this is what I was thinking of. Awesome :) > I recall there being type defs for appropriate atomic types. If that > is still the recommended approach, please update your patch > appropriately. Right. I knew next to nothing about the gcc atom

[RFC] cleanup of #includes

2013-11-14 Thread Justus Winter
Hi :) I've been playing with include-what-you-use [0] (iwyu in Debian). Unfortunately iwyu depends on clang-3.{3,4} which is not currently avaliable on Debian/Hurd, so I'm using a horrible^Wingenious hack that runs iwyu on Linux while the actual build runs on Hurd. 0: https://code.google.com/p/in

[PATCH] libihash: cleanup the #includes

2013-11-14 Thread Justus Winter
* libihash/ihash.c: Cleanup #includes. --- libihash/ihash.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libihash/ihash.c b/libihash/ihash.c index fe9eaed..e813f63 100644 --- a/libihash/ihash.c +++ b/libihash/ihash.c @@ -25,14 +25,12 @@ #include #endif

[PATCH] Clean up the included header files

2013-11-15 Thread Justus Winter
* libihash/ihash.c: Clean up the included header files. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/canon-host.c: Likewise. * libshouldbeinlibc/fsysops.c: Likewise. * libshouldbeinlibc/idvec-auth.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/idvec.h: Likewi

Re: [PATCH] libports: implement lockless management of threads

2013-11-15 Thread Justus Winter
Hi :) youpi wrote: > Now, there is no need for the two counters to be updated coherently, > they are used for different reasons, and don't actually interfere. Also, > mixing them into one int reduces the maximum number of threads to 65535, > which is not so big. > > So I'd say please move to using

[PATCH] libports: implement lockless management of threads

2013-11-15 Thread Justus Winter
ports_manage_port_operations_multithread uses two values, totalthreads and nreqthreads, to manage the threads it creates. Previously a lock was used to synchronize the access to them. Use atomic operations instead. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Use

[PATCH 1/6] libdiskfs: remove dead assignment

2013-11-16 Thread Justus Winter
Found using the Clang Static Analyzer. * libdiskfs/io-write.c (diskfs_S_io_write): Remove dead assignment. --- libdiskfs/io-write.c |1 - 1 file changed, 1 deletion(-) diff --git a/libdiskfs/io-write.c b/libdiskfs/io-write.c index 26e0be4..2967c4c 100644 --- a/libdiskfs/io-write.c +++ b/libd

[PATCH 2/6] libdiskfs: fix error handling

2013-11-16 Thread Justus Winter
Found using the Clang Static Analyzer. * libdiskfs/dir-renamed.c (diskfs_rename_dir): Fix error handling. --- libdiskfs/dir-renamed.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c index d73dc28..9b7ec3a 100644 --- a/libdis

[PATCH 3/6] ext2fs: fix error handling

2013-11-16 Thread Justus Winter
Found using the Clang Static Analyzer. * ext2fs/dir.c (diskfs_lookup_hard): Fix error handling. --- ext2fs/dir.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/ext2fs/dir.c b/ext2fs/dir.c index c075246..a7eeaaa 100644 --- a/ext2fs/dir.c +++ b/ext2fs/dir.c @@ -195,6 +195,8 @@ diskfs_look

Clang Static Analyzer reports & more fixes for the Hurd

2013-11-16 Thread Justus Winter
Hi folks :) I've been using the Clang Static Analyzer to analyze the Hurd and GNU Mach source. The results are here (until a more permanent home is found and an automated build system is in place): http://darnassus.sceen.net/~teythoon/qa/ I've seen Marin has joined in fixing bugs in Mach based o

[PATCH 5/6] mach-defpager: fix the page offsets returned by pager_pages

2013-11-16 Thread Justus Winter
Previously the increment was outside the loop body, turning it into a dead increment. Move the increment into the loop body as it is done in the true branch above. This fixes the offsets recorded in the default_pager_page_t objects. Found using the Clang Static Analyzer. * mach-defpager/default_

[PATCH 6/6] mach-defpager: do not remove -Wall from CFLAGS

2013-11-16 Thread Justus Winter
Bother, said Pooh. * Makefile: Do not remove -Wall from CFLAGS. --- mach-defpager/Makefile |3 --- 1 file changed, 3 deletions(-) diff --git a/mach-defpager/Makefile b/mach-defpager/Makefile index 5a98d69..e38a0be 100644 --- a/mach-defpager/Makefile +++ b/mach-defpager/Makefile @@ -35,6 +35,

[PATCH 4/6] libshouldbeinlibc: fix dead assignment

2013-11-16 Thread Justus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/timefmt.c (fmt_past_time): Fix dead assignment, normalize adjacent white space. --- libshouldbeinlibc/timefmt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libshouldbeinlibc/timefmt.c b/libshouldbeinlibc/t

Re: [PATCH] libports: implement lockless management of threads

2013-11-16 Thread Justus Winter
Quoting Samuel Thibault (2013-11-16 11:16:02) > > - pthread_spin_lock (&lock); > > - if (nreqthreads == 1) > > + __atomic_sub_fetch (&totalthreads, 1, __ATOMIC_RELAXED); > > + if (__atomic_sub_fetch (&nreqthreads, 1, __ATOMIC_RELAXED) == 0) > > { > > /*

Re: [PATCH 1/2] Add copyright

2013-11-18 Thread Justus Winter
Quoting Marin Ramesa (2013-11-18 09:38:56) > * ddb/db_write_cmd.h: Add copyright. > * ipc/ipc_print.h: Likewise. > * vm/vm_print.h: Likewise. > > --- > ddb/db_write_cmd.h | 18 ++ > ipc/ipc_print.h| 18 ++ > vm/vm_print.h | 18 ++ > 3 files

Re: [PATCH 1/2] Add copyright

2013-11-18 Thread Justus Winter
Quoting Marin Ramesa (2013-11-18 10:26:41) > On 18.11.2013 09:53:34, Justus Winter wrote: > > IANAL, and I do not now if this is ok to do, but the copyright > > template you used is out of date. See > > https://www.gnu.org/licenses/gpl-howto.html. > > I don'

[PATCH 2/3] trans: populate the mtab on demand

2013-11-20 Thread Justus Winter
Previously the mtab content was generated in the open hook. Delay this until the data is needed. A follow up patch will take advantage of this to both simplify the logic in mtab_populate and make it more robust at the same time. * trans/mtab.c (open_hook): Do not eagerly populate the mtab. (trivfs

[PATCH 1/3] trans: make the mtab translator a multithreaded server

2013-11-20 Thread Justus Winter
* trans/mtab.c (main): Use ports_manage_port_operations_multithread. --- trans/mtab.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trans/mtab.c b/trans/mtab.c index 250de7d..4d10632 100644 --- a/trans/mtab.c +++ b/trans/mtab.c @@ -233,9 +233,13 @@ main (int argc

[PATCH 3/3] trans: remove the loop detection logic from the mtab translator

2013-11-20 Thread Justus Winter
Previously the mtab detector tried to detect whether it talks to itself by comparing the control port of the translator it currently visits with its own. This was done to prevent deadlocks. However, this did not detect non-trivial loops, i.e. two mtab translators would still dead-lock each other.

Re: [PATCH 2/3] trans: populate the mtab on demand

2013-11-20 Thread Justus Winter
Quoting Richard Braun (2013-11-20 12:13:20) > On Wed, Nov 20, 2013 at 11:10:07AM +0100, Justus Winter wrote: > > Previously the mtab content was generated in the open hook. Delay this > > until the data is needed. A follow up patch will take advantage of > > this to both

[PATCH 01/12] init: remove unused function run_for_real

2013-11-20 Thread Justus Winter
* init/init.c (run_for_real): Remove function. --- init/init.c | 89 --- 1 file changed, 89 deletions(-) diff --git a/init/init.c b/init/init.c index de5dd6b..0adde79 100644 --- a/init/init.c +++ b/init/init.c @@ -405,95 +405,6 @@ run (con

[PATCH 04/12] libnetfs: fix a dead store

2013-11-20 Thread Justus Winter
* libnetfs/fsys-getroot.c (netfs_S_fsys_getroot): Fix dead store. --- libnetfs/fsys-getroot.c |1 - 1 file changed, 1 deletion(-) diff --git a/libnetfs/fsys-getroot.c b/libnetfs/fsys-getroot.c index 0d80111..d3dda17 100644 --- a/libnetfs/fsys-getroot.c +++ b/libnetfs/fsys-getroot.c @@ -84,7 +

[PATCH 02/12] utils: fix dead initialization

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * utils/frobauth.c (posix_parse_opt): Fix dead initialization. (no_ugids_parse_opt): Likewise. --- utils/frobauth.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/frobauth.c b/utils/frobauth.c index ccb7c3b..44690d8 100644 -

[PATCH 05/12] fatfs: fix error handling in diskfs_lookup_hard

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * fatfs/dir.c (diskfs_lookup_hard): Fix error handling. --- fatfs/dir.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/fatfs/dir.c b/fatfs/dir.c index b2b7d7e..60fc898 100644 --- a/fatfs/dir.c +++ b/fatfs/dir.c @@ -231,6 +231,8 @@ diskfs_lookup_har

[PATCH 12/12] libshouldbeinlibc: fix error handling in maptime_map

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/maptime.c (maptime_map): Fix error handling. --- libshouldbeinlibc/maptime.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c index 971e05f..ca3

[PATCH 03/12] libps: fix the length computation in fprint_frac_value

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * libps/spec.c (fprint_frac_value): Fix computation of value_len. --- libps/spec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libps/spec.c b/libps/spec.c index b34a234..146aba5 100644 --- a/libps/spec.c +++ b/libps/spec.c @@ -416,

[PATCH 09/12] usermux: actually use the computed flags value in netfs_attempt_utimes

2013-11-20 Thread Justus Winter
If either atime or mtime is NULL, the respective time should be set to the current time. Found using the Clang Static Analyzer. * usermux/node.c (netfs_attempt_utimes): Use flags in call to fshelp_touch. --- usermux/node.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH 08/12] nfsd: fix error handling in op_remove

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * nfsd/ops.c (op_remove): Fix error handling. --- nfsd/ops.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfsd/ops.c b/nfsd/ops.c index d503290..6e2cbb1 100644 --- a/nfsd/ops.c +++ b/nfsd/ops.c @@ -398,7 +398,7 @@ op_remove (struct

[PATCH 06/12] fatfs: fix error handling in diskfs_get_directs

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * fatfs/dir.c (diskfs_get_directs): Fix error handling. --- fatfs/dir.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/fatfs/dir.c b/fatfs/dir.c index 60fc898..5a38c63 100644 --- a/fatfs/dir.c +++ b/fatfs/dir.c @@ -865,6 +865,8 @@ diskfs_get_direct

[PATCH 07/12] ftpfs: fix error handling in refresh_dir

2013-11-20 Thread Justus Winter
Found using the Clang Static Analyzer. * ftpfs/dir.c (refresh_dir): Fix error handling. --- ftpfs/dir.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ftpfs/dir.c b/ftpfs/dir.c index da5ddbe..61c337b 100644 --- a/ftpfs/dir.c +++ b/ftpfs/dir.c @@ -381,8 +381,12 @@

<    1   2   3   4   5   6   7   8   9   10   >