summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/os_common
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/os_common')
-rw-r--r--src/third_party/wiredtiger/src/os_common/os_fhandle.c1
-rw-r--r--src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/os_common/os_fhandle.c b/src/third_party/wiredtiger/src/os_common/os_fhandle.c
index 18bdb756176..c13a1a2010d 100644
--- a/src/third_party/wiredtiger/src/os_common/os_fhandle.c
+++ b/src/third_party/wiredtiger/src/os_common/os_fhandle.c
@@ -388,6 +388,7 @@ __fsync_background(WT_SESSION_IMPL *session, WT_FH *fh)
uint64_t now;
conn = S2C(session);
+ WT_ASSERT_SPINLOCK_OWNED(session, &conn->fh_lock);
WT_STAT_CONN_INCR(session, fsync_all_fh_total);
handle = fh->handle;
diff --git a/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c b/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
index 9450cbba1d5..8e71b399f56 100644
--- a/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
+++ b/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
@@ -34,6 +34,7 @@ __im_handle_search(WT_SESSION_IMPL *session, WT_FILE_SYSTEM *file_system, const
uint64_t bucket, hash;
im_fs = (WT_FILE_SYSTEM_INMEM *)file_system;
+ WT_ASSERT_SPINLOCK_OWNED(session, &im_fs->lock);
hash = __wt_hash_city64(name, strlen(name));
bucket = hash & (S2C(session)->hash_size - 1);
@@ -58,6 +59,13 @@ __im_handle_remove(
im_fs = (WT_FILE_SYSTEM_INMEM *)file_system;
+ /*
+ * We should hold the file system lock unless we are destroying the file system, in which case
+ * would call this with the force argument set to true.
+ */
+ if (!force)
+ WT_ASSERT_SPINLOCK_OWNED(session, &im_fs->lock);
+
if (im_fh->ref != 0) {
__wt_err(session, EBUSY, "%s: file-remove", im_fh->iface.name);
if (!force)