summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 20:10:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 20:10:09 +0000
commita2bea9526ee8adcc65ccd266d9c4b057ec892320 (patch)
treeb33e6a9412200a3524bb31977c64e5e629701c45
parentAdd another mutex in vlogf function calling BOOST_TEST_MESSAGE (diff)
downloadnetfs-a2bea9526ee8adcc65ccd266d9c4b057ec892320.tar.bz2
netfs-a2bea9526ee8adcc65ccd266d9c4b057ec892320.tar.xz
netfs-a2bea9526ee8adcc65ccd266d9c4b057ec892320.zip
Tweak to move volume proxy reset into locked region
-rw-r--r--netfs/fuse/fuseApp.cpp11
-rw-r--r--netfs/fuse/fuseApp.h2
2 files changed, 6 insertions, 7 deletions
diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp
index 734bf91..41f86ef 100644
--- a/netfs/fuse/fuseApp.cpp
+++ b/netfs/fuse/fuseApp.cpp
@@ -166,10 +166,10 @@ NetFS::FuseApp::connectToService()
}
void
-NetFS::FuseApp::connectToVolume()
+NetFS::FuseApp::connectToVolume(bool force)
{
Lock(_lock);
- if (!volume) {
+ if (force || !volume) {
volume = service->connect(fcr->ExportName, fcr->AuthToken);
if (!volume) {
throw std::runtime_error("Invalid filesystem proxy");
@@ -238,7 +238,7 @@ NetFS::FuseApp::onError(const std::exception & e) noexcept
verifyConnection();
connectSession();
connectToService();
- connectToVolume();
+ connectToVolume(false);
connectHandles();
return 0;
}
@@ -248,8 +248,7 @@ NetFS::FuseApp::onError(const std::exception & e) noexcept
}
if (dynamic_cast<const Ice::RequestFailedException *>(&e)) {
try {
- volume = nullptr;
- connectToVolume();
+ connectToVolume(true);
connectHandles();
return 0;
}
@@ -268,7 +267,7 @@ NetFS::FuseApp::beforeOperation()
{
connectSession();
connectToService();
- connectToVolume();
+ connectToVolume(false);
}
NetFS::ReqEnv
diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h
index d373e94..80deed2 100644
--- a/netfs/fuse/fuseApp.h
+++ b/netfs/fuse/fuseApp.h
@@ -38,7 +38,7 @@ namespace NetFS {
protected:
void connectSession();
virtual void connectToService();
- void connectToVolume();
+ void connectToVolume(bool force);
void connectHandles();
void verifyConnection();