From 2f0a0e87b2d4ad6dc7e2adfae096918f98b571e3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 20 Jan 2021 17:54:49 +0200 Subject: [PATCH] lib-index: Move fields from struct mail_index to struct mail_index_settings This clarifies which fields are settings related. --- src/lib-index/mail-cache-purge.c | 2 +- src/lib-index/mail-cache-transaction.c | 2 +- src/lib-index/mail-cache.c | 8 +- src/lib-index/mail-index-lock.c | 6 +- src/lib-index/mail-index-private.h | 37 +++++--- src/lib-index/mail-index-strmap.c | 12 +-- src/lib-index/mail-index-transaction-export.c | 2 +- src/lib-index/mail-index-write.c | 2 +- src/lib-index/mail-index.c | 86 +++++++++---------- src/lib-index/mail-transaction-log-append.c | 4 +- src/lib-index/mail-transaction-log-file.c | 18 ++-- src/lib-index/mail-transaction-log.c | 4 +- 12 files changed, 98 insertions(+), 85 deletions(-) diff --git a/src/lib-index/mail-cache-purge.c b/src/lib-index/mail-cache-purge.c index 5a56f36d11..17cb6ca66b 100644 --- a/src/lib-index/mail-cache-purge.c +++ b/src/lib-index/mail-cache-purge.c @@ -350,7 +350,7 @@ mail_cache_copy(struct mail_cache *cache, struct mail_index_transaction *trans, } o_stream_destroy(&output); - if (cache->index->fsync_mode == FSYNC_MODE_ALWAYS) { + if (cache->index->set.fsync_mode == FSYNC_MODE_ALWAYS) { if (fdatasync(fd) < 0) { mail_cache_set_syscall_error(cache, "fdatasync()"); array_free(ext_offsets); diff --git a/src/lib-index/mail-cache-transaction.c b/src/lib-index/mail-cache-transaction.c index ce1fdb673d..0cdf089eda 100644 --- a/src/lib-index/mail-cache-transaction.c +++ b/src/lib-index/mail-cache-transaction.c @@ -711,7 +711,7 @@ mail_cache_header_fields_write(struct mail_cache *cache, const buffer_t *buffer) if (mail_cache_append(cache, buffer->data, buffer->used, &offset) < 0) return -1; - if (cache->index->fsync_mode == FSYNC_MODE_ALWAYS) { + if (cache->index->set.fsync_mode == FSYNC_MODE_ALWAYS) { if (fdatasync(cache->fd) < 0) { mail_cache_set_syscall_error(cache, "fdatasync()"); return -1; diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index af575e282d..88518fe9db 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -583,7 +583,7 @@ mail_cache_open_or_create_path(struct mail_index *index, const char *path) cache->dotlock_settings.nfs_flush = (index->flags & MAIL_INDEX_OPEN_FLAG_NFS_FLUSH) != 0; cache->dotlock_settings.timeout = - I_MIN(MAIL_CACHE_LOCK_TIMEOUT, index->max_lock_timeout_secs); + I_MIN(MAIL_CACHE_LOCK_TIMEOUT, index->set.max_lock_timeout_secs); cache->dotlock_settings.stale_timeout = MAIL_CACHE_LOCK_CHANGE_TIMEOUT; if (!MAIL_INDEX_IS_IN_MEMORY(index) && @@ -646,9 +646,9 @@ static int mail_cache_lock_file(struct mail_cache *cache) } i_assert(cache->file_lock == NULL); - if (cache->index->lock_method != FILE_LOCK_METHOD_DOTLOCK) { + if (cache->index->set.lock_method != FILE_LOCK_METHOD_DOTLOCK) { timeout_secs = I_MIN(MAIL_CACHE_LOCK_TIMEOUT, - cache->index->max_lock_timeout_secs); + cache->index->set.max_lock_timeout_secs); ret = mail_index_lock_fd(cache->index, cache->filepath, cache->fd, F_WRLCK, @@ -890,7 +890,7 @@ void mail_cache_unlock(struct mail_cache *cache) if (MAIL_CACHE_IS_UNUSABLE(cache)) { /* we found it to be broken during the lock. just clean up. */ cache->hdr_modified = FALSE; - } else if (cache->index->fsync_mode == FSYNC_MODE_ALWAYS) { + } else if (cache->index->set.fsync_mode == FSYNC_MODE_ALWAYS) { if (fdatasync(cache->fd) < 0) mail_cache_set_syscall_error(cache, "fdatasync()"); } diff --git a/src/lib-index/mail-index-lock.c b/src/lib-index/mail-index-lock.c index a7b34b574d..bcfd3d6118 100644 --- a/src/lib-index/mail-index-lock.c +++ b/src/lib-index/mail-index-lock.c @@ -32,7 +32,7 @@ int mail_index_lock_fd(struct mail_index *index, const char *path, int fd, return 1; } - return file_wait_lock(fd, path, lock_type, index->lock_method, + return file_wait_lock(fd, path, lock_type, index->set.lock_method, timeout_secs, lock_r); } @@ -45,8 +45,8 @@ void mail_index_flush_read_cache(struct mail_index *index, const char *path, /* Assume flock() is emulated with fcntl(), because that's how most OSes work nowadays. */ if (locked && - (index->lock_method == FILE_LOCK_METHOD_FCNTL || - index->lock_method == FILE_LOCK_METHOD_FLOCK)) { + (index->set.lock_method == FILE_LOCK_METHOD_FCNTL || + index->set.lock_method == FILE_LOCK_METHOD_FLOCK)) { nfs_flush_read_cache_locked(path, fd); } else { nfs_flush_read_cache_unlocked(path, fd); diff --git a/src/lib-index/mail-index-private.h b/src/lib-index/mail-index-private.h index 5b4b94833c..901ac558de 100644 --- a/src/lib-index/mail-index-private.h +++ b/src/lib-index/mail-index-private.h @@ -148,9 +148,32 @@ union mail_index_module_context { struct mail_index_module_register *reg; }; +struct mail_index_settings { + /* Directory path for .cache file. Set via + mail_index_set_cache_dir(). */ + char *cache_dir; + + /* fsyncing behavior. Set via mail_index_set_fsync_mode(). */ + enum fsync_mode fsync_mode; + enum mail_index_fsync_mask fsync_mask; + + /* Index file permissions. Set via mail_index_set_permissions(). */ + mode_t mode; + gid_t gid; + char *gid_origin; + + /* Lock settings. Set via mail_index_set_lock_method(). */ + enum file_lock_method lock_method; + unsigned int max_lock_timeout_secs; + + /* Initial extension added to newly created indexes. Set via + mail_index_set_ext_init_data(). */ + uint32_t ext_hdr_init_id; + void *ext_hdr_init_data; +}; + struct mail_index { char *dir, *prefix; - char *cache_dir; struct event *event; struct mail_cache *cache; @@ -158,21 +181,14 @@ struct mail_index { unsigned int open_count; enum mail_index_open_flags flags; - enum fsync_mode fsync_mode; - enum mail_index_fsync_mask fsync_mask; - mode_t mode; - gid_t gid; - char *gid_origin; + struct mail_index_settings set; struct mail_index_optimization_settings optimization_set; uint32_t pending_log2_rotate_time; pool_t extension_pool; ARRAY(struct mail_index_registered_ext) extensions; - uint32_t ext_hdr_init_id; - void *ext_hdr_init_data; - ARRAY(mail_index_sync_lost_handler_t *) sync_lost_handlers; char *filepath; @@ -204,9 +220,6 @@ struct mail_index { /* syncing will update this if non-NULL */ struct mail_index_transaction_commit_result *sync_commit_result; - enum file_lock_method lock_method; - unsigned int max_lock_timeout_secs; - pool_t keywords_pool; ARRAY_TYPE(keywords) keywords; HASH_TABLE(char *, void *) keywords_hash; /* name -> unsigned int idx */ diff --git a/src/lib-index/mail-index-strmap.c b/src/lib-index/mail-index-strmap.c index b1b3849838..7d74f978e6 100644 --- a/src/lib-index/mail-index-strmap.c +++ b/src/lib-index/mail-index-strmap.c @@ -1001,9 +1001,9 @@ static int mail_index_strmap_recreate(struct mail_index_strmap_view *view) str = t_str_new(256); str_append(str, strmap->path); - fd = safe_mkstemp_hostpid_group(str, view->view->index->mode, - view->view->index->gid, - view->view->index->gid_origin); + fd = safe_mkstemp_hostpid_group(str, view->view->index->set.mode, + view->view->index->set.gid, + view->view->index->set.gid_origin); temp_path = str_c(str); if (fd == -1) { @@ -1043,13 +1043,13 @@ static int mail_index_strmap_lock(struct mail_index_strmap *strmap) i_assert(strmap->fd != -1); - if (strmap->index->lock_method != FILE_LOCK_METHOD_DOTLOCK) { + if (strmap->index->set.lock_method != FILE_LOCK_METHOD_DOTLOCK) { i_assert(strmap->file_lock == NULL); timeout_secs = I_MIN(MAIL_INDEX_STRMAP_TIMEOUT_SECS, - strmap->index->max_lock_timeout_secs); + strmap->index->set.max_lock_timeout_secs); ret = file_wait_lock(strmap->fd, strmap->path, F_WRLCK, - strmap->index->lock_method, timeout_secs, + strmap->index->set.lock_method, timeout_secs, &strmap->file_lock); if (ret <= 0) { mail_index_strmap_set_syscall_error(strmap, diff --git a/src/lib-index/mail-index-transaction-export.c b/src/lib-index/mail-index-transaction-export.c index 0d59b4d352..87b5006f4d 100644 --- a/src/lib-index/mail-index-transaction-export.c +++ b/src/lib-index/mail-index-transaction-export.c @@ -527,7 +527,7 @@ void mail_index_transaction_export(struct mail_index_transaction *t, append_ctx->index_sync_transaction = t->sync_transaction; append_ctx->tail_offset_changed = t->tail_offset_changed; append_ctx->want_fsync = - (t->view->index->fsync_mask & change_mask) != 0 || + (t->view->index->set.fsync_mask & change_mask) != 0 || (t->flags & MAIL_INDEX_TRANSACTION_FLAG_FSYNC) != 0; } diff --git a/src/lib-index/mail-index-write.c b/src/lib-index/mail-index-write.c index 7684d353a1..9fb5784480 100644 --- a/src/lib-index/mail-index-write.c +++ b/src/lib-index/mail-index-write.c @@ -90,7 +90,7 @@ static int mail_index_recreate(struct mail_index *index) } o_stream_destroy(&output); - if (ret == 0 && index->fsync_mode != FSYNC_MODE_NEVER) { + if (ret == 0 && index->set.fsync_mode != FSYNC_MODE_NEVER) { if (fdatasync(fd) < 0) { mail_index_file_set_syscall_error(index, path, "fdatasync()"); diff --git a/src/lib-index/mail-index.c b/src/lib-index/mail-index.c index cf2d4c7e72..21ffb2e4cc 100644 --- a/src/lib-index/mail-index.c +++ b/src/lib-index/mail-index.c @@ -74,10 +74,10 @@ struct mail_index *mail_index_alloc(struct event *parent_event, i_array_init(&index->module_contexts, I_MIN(5, mail_index_module_register.id)); - index->mode = 0600; - index->gid = (gid_t)-1; - index->lock_method = FILE_LOCK_METHOD_FCNTL; - index->max_lock_timeout_secs = UINT_MAX; + index->set.mode = 0600; + index->set.gid = (gid_t)-1; + index->set.lock_method = FILE_LOCK_METHOD_FCNTL; + index->set.max_lock_timeout_secs = UINT_MAX; index->optimization_set = default_optimization_set; index->keywords_ext_id = @@ -110,9 +110,9 @@ void mail_index_free(struct mail_index **_index) array_free(&index->module_contexts); event_unref(&index->event); - i_free(index->cache_dir); - i_free(index->ext_hdr_init_data); - i_free(index->gid_origin); + i_free(index->set.cache_dir); + i_free(index->set.ext_hdr_init_data); + i_free(index->set.gid_origin); i_free(index->error); i_free(index->dir); i_free(index->prefix); @@ -122,16 +122,16 @@ void mail_index_free(struct mail_index **_index) void mail_index_set_cache_dir(struct mail_index *index, const char *dir) { - i_free(index->cache_dir); - index->cache_dir = i_strdup(dir); + i_free(index->set.cache_dir); + index->set.cache_dir = i_strdup(dir); } void mail_index_set_fsync_mode(struct mail_index *index, enum fsync_mode mode, enum mail_index_fsync_mask mask) { - index->fsync_mode = mode; - index->fsync_mask = mask; + index->set.fsync_mode = mode; + index->set.fsync_mask = mask; } bool mail_index_use_existing_permissions(struct mail_index *index) @@ -147,43 +147,43 @@ bool mail_index_use_existing_permissions(struct mail_index *index) return FALSE; } - index->mode = st.st_mode & 0666; + index->set.mode = st.st_mode & 0666; if (S_ISDIR(st.st_mode) && (st.st_mode & S_ISGID) != 0) { /* directory's GID is used automatically for new files */ - index->gid = (gid_t)-1; + index->set.gid = (gid_t)-1; } else if ((st.st_mode & 0070) >> 3 == (st.st_mode & 0007)) { /* group has same permissions as world, so don't bother changing it */ - index->gid = (gid_t)-1; + index->set.gid = (gid_t)-1; } else if (getegid() == st.st_gid) { /* using our own gid, no need to change it */ - index->gid = (gid_t)-1; + index->set.gid = (gid_t)-1; } else { - index->gid = st.st_gid; + index->set.gid = st.st_gid; } - i_free(index->gid_origin); - if (index->gid != (gid_t)-1) - index->gid_origin = i_strdup("preserved existing GID"); + i_free(index->set.gid_origin); + if (index->set.gid != (gid_t)-1) + index->set.gid_origin = i_strdup("preserved existing GID"); return TRUE; } void mail_index_set_permissions(struct mail_index *index, mode_t mode, gid_t gid, const char *gid_origin) { - index->mode = mode & 0666; - index->gid = gid; + index->set.mode = mode & 0666; + index->set.gid = gid; - i_free(index->gid_origin); - index->gid_origin = i_strdup(gid_origin); + i_free(index->set.gid_origin); + index->set.gid_origin = i_strdup(gid_origin); } void mail_index_set_lock_method(struct mail_index *index, enum file_lock_method lock_method, unsigned int max_timeout_secs) { - index->lock_method = lock_method; - index->max_lock_timeout_secs = max_timeout_secs; + index->set.lock_method = lock_method; + index->set.max_lock_timeout_secs = max_timeout_secs; } void mail_index_set_optimization_settings(struct mail_index *index, @@ -234,16 +234,16 @@ void mail_index_set_ext_init_data(struct mail_index *index, uint32_t ext_id, { const struct mail_index_registered_ext *rext; - i_assert(index->ext_hdr_init_data == NULL || - index->ext_hdr_init_id == ext_id); + i_assert(index->set.ext_hdr_init_data == NULL || + index->set.ext_hdr_init_id == ext_id); rext = array_idx(&index->extensions, ext_id); i_assert(rext->hdr_size == size); - index->ext_hdr_init_id = ext_id; - i_free(index->ext_hdr_init_data); - index->ext_hdr_init_data = i_malloc(size); - memcpy(index->ext_hdr_init_data, data, size); + index->set.ext_hdr_init_id = ext_id; + i_free(index->set.ext_hdr_init_data); + index->set.ext_hdr_init_data = i_malloc(size); + memcpy(index->set.ext_hdr_init_data, data, size); } uint32_t mail_index_ext_register(struct mail_index *index, const char *name, @@ -555,7 +555,7 @@ int mail_index_create_tmp_file(struct mail_index *index, path = *path_r = t_strconcat(path_prefix, ".tmp", NULL); old_mask = umask(0); - fd = open(path, O_RDWR|O_CREAT|O_EXCL, index->mode); + fd = open(path, O_RDWR|O_CREAT|O_EXCL, index->set.mode); umask(old_mask); if (fd == -1 && errno == EEXIST) { /* stale temp file. unlink and recreate rather than overwriting, @@ -563,7 +563,7 @@ int mail_index_create_tmp_file(struct mail_index *index, if (i_unlink(path) < 0) return -1; old_mask = umask(0); - fd = open(path, O_RDWR|O_CREAT|O_EXCL, index->mode); + fd = open(path, O_RDWR|O_CREAT|O_EXCL, index->set.mode); umask(old_mask); } if (fd == -1) { @@ -579,8 +579,8 @@ static const char *mail_index_get_cache_path(struct mail_index *index) { const char *dir; - if (index->cache_dir != NULL) - dir = index->cache_dir; + if (index->set.cache_dir != NULL) + dir = index->set.cache_dir; else if (index->dir != NULL) dir = index->dir; else @@ -698,7 +698,7 @@ int mail_index_open(struct mail_index *index, enum mail_index_open_flags flags) event_unset_forced_debug(index->event); if ((flags & MAIL_INDEX_OPEN_FLAG_NFS_FLUSH) != 0 && - index->fsync_mode != FSYNC_MODE_ALWAYS) + index->set.fsync_mode != FSYNC_MODE_ALWAYS) i_fatal("nfs flush requires mail_fsync=always"); if ((flags & MAIL_INDEX_OPEN_FLAG_NFS_FLUSH) != 0 && (flags & MAIL_INDEX_OPEN_FLAG_MMAP_DISABLE) == 0) @@ -1013,13 +1013,13 @@ void mail_index_fchown(struct mail_index *index, int fd, const char *path) { mode_t mode; - if (index->gid == (gid_t)-1) { + if (index->set.gid == (gid_t)-1) { /* no gid changing */ return; - } else if (fchown(fd, (uid_t)-1, index->gid) == 0) { + } else if (fchown(fd, (uid_t)-1, index->set.gid) == 0) { /* success */ return; - } if ((index->mode & 0060) >> 3 == (index->mode & 0006)) { + } if ((index->set.mode & 0060) >> 3 == (index->set.mode & 0006)) { /* group and world permissions are the same, so group doesn't really matter. ignore silently. */ return; @@ -1028,15 +1028,15 @@ void mail_index_fchown(struct mail_index *index, int fd, const char *path) mail_index_file_set_syscall_error(index, path, "fchown()"); else { mail_index_set_error(index, "%s", - eperm_error_get_chgrp("fchown", path, index->gid, - index->gid_origin)); + eperm_error_get_chgrp("fchown", path, index->set.gid, + index->set.gid_origin)); } /* continue, but change permissions so that only the common subset of group and world is used. this makes sure no one gets any extra permissions. */ - mode = ((index->mode & 0060) >> 3) & (index->mode & 0006); - mode |= (mode << 3) | (index->mode & 0600); + mode = ((index->set.mode & 0060) >> 3) & (index->set.mode & 0006); + mode |= (mode << 3) | (index->set.mode & 0600); if (fchmod(fd, mode) < 0) mail_index_file_set_syscall_error(index, path, "fchmod()"); } diff --git a/src/lib-index/mail-transaction-log-append.c b/src/lib-index/mail-transaction-log-append.c index 26cf440ae2..d78b99be49 100644 --- a/src/lib-index/mail-transaction-log-append.c +++ b/src/lib-index/mail-transaction-log-append.c @@ -89,8 +89,8 @@ static int log_buffer_write(struct mail_transaction_log_append_ctx *ctx) file->max_tail_offset); if ((ctx->want_fsync && - file->log->index->fsync_mode != FSYNC_MODE_NEVER) || - file->log->index->fsync_mode == FSYNC_MODE_ALWAYS) { + file->log->index->set.fsync_mode != FSYNC_MODE_NEVER) || + file->log->index->set.fsync_mode == FSYNC_MODE_ALWAYS) { if (fdatasync(file->fd) < 0) { mail_index_file_set_syscall_error(ctx->log->index, file->filepath, diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 16bda9eb02..68f1824d6e 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -371,7 +371,7 @@ int mail_transaction_log_file_lock(struct mail_transaction_log_file *file) return 0; } - if (file->log->index->lock_method == FILE_LOCK_METHOD_DOTLOCK) + if (file->log->index->set.lock_method == FILE_LOCK_METHOD_DOTLOCK) return mail_transaction_log_file_dotlock(file); if (file->log->index->readonly) { @@ -383,7 +383,7 @@ int mail_transaction_log_file_lock(struct mail_transaction_log_file *file) i_assert(file->file_lock == NULL); lock_timeout_secs = I_MIN(MAIL_TRANSACTION_LOG_LOCK_TIMEOUT, - file->log->index->max_lock_timeout_secs); + file->log->index->set.max_lock_timeout_secs); ret = mail_index_lock_fd(file->log->index, file->filepath, file->fd, F_WRLCK, lock_timeout_secs, &file->file_lock); @@ -401,7 +401,7 @@ int mail_transaction_log_file_lock(struct mail_transaction_log_file *file) "Timeout (%us) while waiting for lock for " "transaction log file %s%s", lock_timeout_secs, file->filepath, - file_lock_find(file->fd, file->log->index->lock_method, F_WRLCK)); + file_lock_find(file->fd, file->log->index->set.lock_method, F_WRLCK)); file->log->index->index_lock_timeout = TRUE; return -1; } @@ -426,7 +426,7 @@ void mail_transaction_log_file_unlock(struct mail_transaction_log_file *file, file->filepath, lock_time, lock_reason); } - if (file->log->index->lock_method == FILE_LOCK_METHOD_DOTLOCK) { + if (file->log->index->set.lock_method == FILE_LOCK_METHOD_DOTLOCK) { (void)mail_transaction_log_file_undotlock(file); return; } @@ -645,7 +645,7 @@ static void log_write_ext_hdr_init_data(struct mail_index *index, buffer_t *buf) struct mail_transaction_ext_hdr_update *ext_hdr; unsigned int hdr_offset; - rext = array_idx(&index->extensions, index->ext_hdr_init_id); + rext = array_idx(&index->extensions, index->set.ext_hdr_init_id); /* introduce the extension */ hdr_offset = buf->used; @@ -672,7 +672,7 @@ static void log_write_ext_hdr_init_data(struct mail_index *index, buffer_t *buf) ext_hdr = buffer_append_space_unsafe(buf, sizeof(*ext_hdr)); ext_hdr->size = rext->hdr_size; - buffer_append(buf, index->ext_hdr_init_data, rext->hdr_size); + buffer_append(buf, index->set.ext_hdr_init_data, rext->hdr_size); hdr = buffer_get_space_unsafe(buf, hdr_offset, sizeof(*hdr)); hdr->size = mail_index_uint32_to_offset(buf->used - hdr_offset); @@ -771,14 +771,14 @@ mail_transaction_log_file_create2(struct mail_transaction_log_file *file, writebuf = t_buffer_create(128); buffer_append(writebuf, &file->hdr, sizeof(file->hdr)); - if (index->ext_hdr_init_data != NULL && reset) + if (index->set.ext_hdr_init_data != NULL && reset) log_write_ext_hdr_init_data(index, writebuf); if (write_full(new_fd, writebuf->data, writebuf->used) < 0) { log_file_set_syscall_error(file, "write_full()"); return -1; } - if (file->log->index->fsync_mode == FSYNC_MODE_ALWAYS) { + if (file->log->index->set.fsync_mode == FSYNC_MODE_ALWAYS) { /* the header isn't important, so don't bother calling fdatasync() unless it's required */ if (fdatasync(new_fd) < 0) { @@ -870,7 +870,7 @@ int mail_transaction_log_file_create(struct mail_transaction_log_file *file, /* With dotlocking we might already have path.lock created, so this filename has to be different. */ - old_mask = umask(index->mode ^ 0666); + old_mask = umask(index->set.mode ^ 0666); fd = file_dotlock_open(&new_dotlock_set, file->filepath, 0, &dotlock); umask(old_mask); diff --git a/src/lib-index/mail-transaction-log.c b/src/lib-index/mail-transaction-log.c index 1cb2fdd95c..c0a1c41b16 100644 --- a/src/lib-index/mail-transaction-log.c +++ b/src/lib-index/mail-transaction-log.c @@ -320,7 +320,7 @@ int mail_transaction_log_rotate(struct mail_transaction_log *log, bool reset) mail_index_set_error(log->index, "Transaction log %s was recreated while we had it locked - " "locking is broken (lock_method=%s)", path, - file_lock_method_to_str(log->index->lock_method)); + file_lock_method_to_str(log->index->set.lock_method)); mail_transaction_log_file_free(&file); return -1; } @@ -654,7 +654,7 @@ void mail_transaction_log_get_dotlock_set(struct mail_transaction_log *log, i_zero(set_r); set_r->timeout = I_MIN(MAIL_TRANSACTION_LOG_LOCK_TIMEOUT, - index->max_lock_timeout_secs); + index->set.max_lock_timeout_secs); set_r->stale_timeout = MAIL_TRANSACTION_LOG_LOCK_CHANGE_TIMEOUT; set_r->nfs_flush = (index->flags & MAIL_INDEX_OPEN_FLAG_NFS_FLUSH) != 0; set_r->use_excl_lock = -- 2.47.3