From 000e85611645548eb53c67286e47c7059d587169 Mon Sep 17 00:00:00 2001 From: Arturo Bernal Date: Tue, 1 Dec 2026 12:03:24 +0100 Subject: [PATCH] mod_dav_fs: Close the lock database before releasing its mutex. dav_fs_lockdb_cleanup() released the lockdb mutex before closing the database, so the close, which commits pending writes, could overlap the next opener, and the same LMDB database could then be open twice in one process, which LMDB does not allow. With a driver that keeps LMDB's own locking, concurrent requests crash the child. * modules/dav/fs/lock.c (dav_fs_lockdb_cleanup): Release the mutex after closing the database. PR: 70196 --- modules/dav/fs/lock.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/dav/fs/lock.c b/modules/dav/fs/lock.c index 7dd8d7326e0..cec5e155275 100644 --- a/modules/dav/fs/lock.c +++ b/modules/dav/fs/lock.c @@ -295,12 +295,14 @@ static apr_status_t dav_fs_lockdb_cleanup(void *data) { dav_lockdb *lockdb = data; - apr_global_mutex_unlock(lockdb->info->conf->lockdb_mutex); - + /* Close the database before releasing the mutex: closing commits + * pending writes, and the next opener must not overlap it. */ if (lockdb->info->db) { dav_dbm_close(lockdb->info->db); } - + + apr_global_mutex_unlock(lockdb->info->conf->lockdb_mutex); + return APR_SUCCESS; }