Skip to content
Snippets Groups Projects
Commit f593db1b authored by Ren Bauer's avatar Ren Bauer Committed by Michael Davis
Browse files

Resolve "Open BackendVFS ObjectStore files in R/W mode when obtaining exclusive locks"

parent 0010995d
No related branches found
No related tags found
No related merge requests found
......@@ -254,7 +254,11 @@ void BackendVFS::ScopedLock::release() {
BackendVFS::ScopedLock * BackendVFS::lockHelper(const std::string& name, int type, uint64_t timeout_us) {
std::string path = m_root + "/." + name + ".lock";
std::unique_ptr<ScopedLock> ret(new ScopedLock);
ret->set(::open(path.c_str(), O_RDONLY), path);
int flag = O_RDONLY;
if (type == LOCK_EX) {
flag = O_RDWR;
}
ret->set(::open(path.c_str(), flag), path);
if(0 > ret->m_fd) {
// We went too fast: the fd is not really set:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment