From d97247860a39faaf3bf83beabd3fbb9f136e4999 Mon Sep 17 00:00:00 2001 From: Cyprien Noel Date: Sun, 25 Sep 2016 14:39:14 -0700 Subject: [PATCH] Handle filesystems without lock support. NFS can be setup this way. --- src/caffe/util/db_lmdb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caffe/util/db_lmdb.cpp b/src/caffe/util/db_lmdb.cpp index fb1d4956aa1..bde4bc798f6 100644 --- a/src/caffe/util/db_lmdb.cpp +++ b/src/caffe/util/db_lmdb.cpp @@ -20,8 +20,8 @@ void LMDB::Open(const string& source, Mode mode) { #ifndef ALLOW_LMDB_NOLOCK MDB_CHECK(rc); #else - if (rc == EACCES) { - LOG(WARNING) << "Permission denied. Trying with MDB_NOLOCK ..."; + if (rc == EACCES || rc == ENOLCK) { + LOG(WARNING) << "Permission denied or no locks. Trying with MDB_NOLOCK ..."; // Close and re-open environment handle mdb_env_close(mdb_env_); MDB_CHECK(mdb_env_create(&mdb_env_));