iolog: ensure we always store compressed, if log_store_compressed == 1
authorJens Axboe <axboe@fb.com>
Tue, 8 Dec 2015 04:56:34 +0000 (21:56 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 8 Dec 2015 04:56:34 +0000 (21:56 -0700)
Before this commit, we depend on log_compression= always being set.
But we might want the logs store compressed, even if we don't
continually compress chunks at runtime.

Signed-off-by: Jens Axboe <axboe@fb.com>
iolog.c

diff --git a/iolog.c b/iolog.c
index 82b2b8a3ec40084853655a42d5494a4e9bbf91bf..d7c8a45dae4dbe9a4bf577ba4fcbaf5e9ae35a94 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -594,7 +594,7 @@ void setup_log(struct io_log **log, struct log_params *p,
 
        if (l->log_gz && !p->td)
                l->log_gz = 0;
-       else if (l->log_gz) {
+       else if (l->log_gz || l->log_gz_store) {
                pthread_mutex_init(&l->chunk_lock, NULL);
                p->td->flags |= TD_F_COMPRESS_LOG;
        }