diff options
author | Bernd Schubert <bernd.schubert@fastmail.fm> | 2023-02-15 11:10:47 +0100 |
---|---|---|
committer | Radek Podgorny <radek@podgorny.cz> | 2023-02-15 11:43:14 +0100 |
commit | 9cfb46a4f590fc99d6eef09a78eb829b7a634979 (patch) | |
tree | 93954f534928ba9a9c7ccbc512b7dbe4bcfc066f | |
parent | 12baaf0bf8ab0f90930bb0ff06cc4458c3549971 (diff) | |
download | unionfs-fuse-git-9cfb46a4f590fc99d6eef09a78eb829b7a634979.tar.gz |
disable usyslog for now as it has severe code issues
usyslog is severely broken (by my own code) - it should not
be enabled for now at all, until the code gets rewritten.
There are multiple reports already, some fix attempts, but
with simple code changes it just gets worse.
-rw-r--r-- | src/usyslog.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/usyslog.c b/src/usyslog.c index edf701f..dc1ad76 100644 --- a/src/usyslog.c +++ b/src/usyslog.c @@ -13,6 +13,15 @@ * calls write without a risk to deadlock into the syslog buffer (chained * list) and then the seperate syslog_thread call syslog(). That way our * our filesystem thread(s) cannot stall from syslog() calls. + * + * + * NOTE: usyslog has severe locking issues. It uses two locks obtained in different + * different order - can easily deadlock. + * A much simpler solution would only take one lock and two list heads. + * List gets appended with the lock being hold, and the syslog worker + * thread would just exchange list heads when it is doing syslog. + * It is basically a list splice to let the worker operate without + * any needed and without any possible race. */ #include <stdio.h> @@ -179,6 +188,9 @@ void usyslog(int priority, const char *format, ...) int res; ulogs_t *log; + // severe code issues - see the file header - this code is disabled for now + return; + // Lock the entire list first, which means the syslog thread MUST NOT // lock it if there is any chance it might be locked forever. pthread_mutex_lock(&list_lock); @@ -259,6 +271,9 @@ void usyslog(int priority, const char *format, ...) */ void init_syslog(void) { + // severe code issues - see the file header - this code is disabled for now + return; + openlog("unionfs-fuse: ", LOG_CONS | LOG_NDELAY | LOG_NOWAIT | LOG_PID, LOG_DAEMON); pthread_mutex_init(&list_lock, NULL); |