diff options
author | Jan Janssen <medhefgo@web.de> | 2014-09-06 10:36:34 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-10 05:16:36 +0200 |
commit | 06cc69d44c8ff2b652527357f28acd4cbe77c814 (patch) | |
tree | e660b1e180df8ac90be013a0fae8a5e148e8ad9e /src/journal/mmap-cache.h | |
parent | sd-journal: change check to assert (diff) | |
download | systemd-06cc69d44c8ff2b652527357f28acd4cbe77c814.tar.xz systemd-06cc69d44c8ff2b652527357f28acd4cbe77c814.zip |
sd-journal: fix sd_journal_enumerate_unique skipping values
sd_journal_enumerate_unique will lock its mmap window to prevent it
from being released by calling mmap_cache_get with keep_always=true.
This call may return windows that are wider, but compatible with the
parameters provided to it.
This can result in a mismatch where the window to be released cannot
properly be selected, because we have more than one window matching the
parameters of mmap_cache_release. Therefore, introduce a release_cookie
to be used when releasing the window.
https://bugs.freedesktop.org/show_bug.cgi?id=79380
Diffstat (limited to 'src/journal/mmap-cache.h')
-rw-r--r-- | src/journal/mmap-cache.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/journal/mmap-cache.h b/src/journal/mmap-cache.h index 647555a73e..76e5316248 100644 --- a/src/journal/mmap-cache.h +++ b/src/journal/mmap-cache.h @@ -40,14 +40,12 @@ int mmap_cache_get( uint64_t offset, size_t size, struct stat *st, - void **ret); + void **ret, + void **release_cookie); int mmap_cache_release( MMapCache *m, int fd, - int prot, - unsigned context, - uint64_t offset, - size_t size); + void *release_cookie); void mmap_cache_close_fd(MMapCache *m, int fd); void mmap_cache_close_context(MMapCache *m, unsigned context); |