summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Anderson <dda@mongodb.com>2017-02-14 16:30:53 -0500
committerKeith Bostic <keith.bostic@mongodb.com>2017-02-14 16:30:53 -0500
commita53bb9683b7f8e4fda3c6272ec8224857e756ba8 (patch)
treea4e715a30e3589072f33031b65c423d0b6419ef6
parenta6a0483f2b4f1617bc1aa1179685b74bad990290 (diff)
downloadmongo-a53bb9683b7f8e4fda3c6272ec8224857e756ba8.tar.gz
WT-3179 test bug: clang sanitizer failure in fail_fs #3300
hold the fs lock while manipulating the list of file handles.
-rw-r--r--ext/test/fail_fs/fail_fs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/test/fail_fs/fail_fs.c b/ext/test/fail_fs/fail_fs.c
index 9445dbf9aca..cb87b43bfd9 100644
--- a/ext/test/fail_fs/fail_fs.c
+++ b/ext/test/fail_fs/fail_fs.c
@@ -156,11 +156,13 @@ static int
fail_file_close(WT_FILE_HANDLE *file_handle, WT_SESSION *session)
{
FAIL_FILE_HANDLE *fail_fh;
+ FAIL_FILE_SYSTEM *fail_fs;
int ret;
(void)session; /* Unused */
fail_fh = (FAIL_FILE_HANDLE *)file_handle;
+ fail_fs = fail_fh->fail_fs;
/*
* We don't actually open an fd when opening directories for flushing,
@@ -170,14 +172,16 @@ fail_file_close(WT_FILE_HANDLE *file_handle, WT_SESSION *session)
return (0);
ret = close(fail_fh->fd);
fail_fh->fd = -1;
+ fail_fs_lock(&fail_fs->lock);
fail_file_handle_remove(session, fail_fh);
+ fail_fs_unlock(&fail_fs->lock);
return (ret);
}
/*
* fail_file_handle_remove --
* Destroy an in-memory file handle. Should only happen on remove or
- * shutdown.
+ * shutdown. The file system lock must be held during this call.
*/
static void
fail_file_handle_remove(WT_SESSION *session, FAIL_FILE_HANDLE *fail_fh)