From a2bea9526ee8adcc65ccd266d9c4b057ec892320 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 9 Jan 2021 20:10:09 +0000 Subject: Tweak to move volume proxy reset into locked region --- netfs/fuse/fuseApp.cpp | 11 +++++------ netfs/fuse/fuseApp.h | 2 +- 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(&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(); -- cgit v1.2.3