]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Fix crash still if fdatasync_path() fails
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Jun 2023 07:48:13 +0000 (10:48 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Jun 2023 07:48:13 +0000 (10:48 +0300)
Broken still in 8bffe291fe5142a2e385de8f4fc7b69caa816522

src/lib-storage/index/dbox-multi/mdbox-save.c

index cfbad96d044b3279c5b46feda8c85fd9d797e26b..588d55629e31c4b5d41857a54a1c44e9fa9279b2 100644 (file)
@@ -374,7 +374,8 @@ void mdbox_transaction_save_commit_post(struct mail_save_context *_ctx,
                                        struct mail_index_transaction_commit_result *result)
 {
        struct mdbox_save_context *ctx = MDBOX_SAVECTX(_ctx);
-       struct mail_storage *_storage = _ctx->transaction->box->storage;
+       struct mailbox *box = _ctx->transaction->box;
+       struct mail_storage *_storage = box->storage;
        struct mdbox_storage *storage =
                container_of(_storage, struct mdbox_storage, storage.storage);
 
@@ -401,7 +402,7 @@ void mdbox_transaction_save_commit_post(struct mail_save_context *_ctx,
 
        if (_storage->set->parsed_fsync_mode != FSYNC_MODE_NEVER) {
                if (fdatasync_path(storage->storage_dir) < 0) {
-                       mailbox_set_critical(_ctx->transaction->box,
+                       mailbox_set_critical(box,
                                "fdatasync_path(%s) failed: %m",
                                storage->storage_dir);
                }