search for: maybe_adjust

Displaying 5 results from an estimated 5 matches for "maybe_adjust".

2019 Jul 31
13
[nbdkit PATCH 0/8] fd leak safety
There's enough here to need a review; some of it probably needs backporting to stable-1.12. This probably breaks tests on Haiku or other platforms that have not been as on-the-ball about atomic CLOEXEC; feel free to report issues that arise, and I'll help come up with workarounds (even if we end up leaving a rare fd leak on less-capable systems). Meanwhile, I'm still working on my
2019 Jul 31
0
[nbdkit PATCH 8/8] rate: Atomically set CLOEXEC on fds
...ke <eblake@redhat.com> --- filters/rate/rate.c | 2 +- server/utils.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/filters/rate/rate.c b/filters/rate/rate.c index f8dda0b0..9476a27f 100644 --- a/filters/rate/rate.c +++ b/filters/rate/rate.c @@ -204,7 +204,7 @@ maybe_adjust (const char *file, struct bucket *bucket, pthread_mutex_t *lock) if (!file) return; - fp = fopen (file, "r"); + fp = fopen (file, "re"); if (fp == NULL) return; /* this is not an error */ diff --git a/server/utils.c b/server/utils.c index eabef200..d7e202ec 10064...
2019 Apr 24
0
[nbdkit PATCH 4/4] filters: Check for mutex failures
...LOCK_FOR_CURRENT_SCOPE (&lock); h->connection = ++connections; - pthread_mutex_unlock (&lock); h->id = 0; return h; } diff --git a/filters/rate/rate.c b/filters/rate/rate.c index 978cdc3..cf03541 100644 --- a/filters/rate/rate.c +++ b/filters/rate/rate.c @@ -222,9 +222,8 @@ maybe_adjust (const char *file, struct bucket *bucket, pthread_mutex_t *lock) if (new_rate == -1) return; - pthread_mutex_lock (lock); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (lock); old_rate = bucket_adjust_rate (bucket, new_rate); - pthread_mutex_unlock (lock); if (old_rate != new_rate) nbdki...
2019 Apr 24
7
[nbdkit PATCH 0/4] More mutex sanity checking
I do have a question about whether patch 2 is right, or whether I've exposed a bigger problem in the truncate (and possibly other) filter, but the rest seem fairly straightforward. Eric Blake (4): server: Check for pthread lock failures truncate: Factor out reading real_size under mutex plugins: Check for mutex failures filters: Check for mutex failures filters/cache/cache.c
2019 Aug 02
23
[nbdkit PATCH v2 00/17] fd leak safety
This is a major rewrite compared to my v1 series, where I've tried a lot harder to ensure that we still accommodate building on Haiku (although I have not actually yet fired up a Haiku VM to try it for myself). I also managed to make the sh plugin fully parallel, on capable platforms. See also my question on patch 10 on whether I've picked the best naming convention. Eric Blake (17):