diff options
author | Andrew Morton <andrew.morton@mongodb.com> | 2023-05-16 22:21:25 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-17 00:50:01 +0000 |
commit | 376eae9eefe9f752d8d9b5189528f1353c019e54 (patch) | |
tree | 8780daf7a9ebd0ed2e8c1b25bf81571b3bb89911 /src/third_party/wiredtiger/src/os_common | |
parent | e94168acd89dba4faef5e43f970633a781e8cba2 (diff) | |
download | mongo-376eae9eefe9f752d8d9b5189528f1353c019e54.tar.gz |
Import wiredtiger: 04dcc362042b8cc35fdd8de8343be3a15d4fa47c from branch mongodb-master
ref: d310d6330e..04dcc36204
for: 7.1.0-rc0
WT-10898 Add assertions for owning a spinlock
Diffstat (limited to 'src/third_party/wiredtiger/src/os_common')
-rw-r--r-- | src/third_party/wiredtiger/src/os_common/os_fhandle.c | 1 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c | 8 |
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) |