diff options
Diffstat (limited to 'src/test/librados_test_stub')
-rw-r--r-- | src/test/librados_test_stub/TestMemIoCtxImpl.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/librados_test_stub/TestMemIoCtxImpl.cc b/src/test/librados_test_stub/TestMemIoCtxImpl.cc index d1f2f8cda51..24b4ac559a3 100644 --- a/src/test/librados_test_stub/TestMemIoCtxImpl.cc +++ b/src/test/librados_test_stub/TestMemIoCtxImpl.cc @@ -108,6 +108,13 @@ int TestMemIoCtxImpl::create(const std::string& oid, bool exclusive, } std::unique_lock l{m_pool->file_lock}; + if (exclusive) { + TestMemCluster::SharedFile file = get_file(oid, false, CEPH_NOSNAP, {}); + if (file != NULL && file->exists) { + return -EEXIST; + } + } + get_file(oid, true, CEPH_NOSNAP, snapc); return 0; } |