From db77e3a4742caf9f4ee18bc71c194edccb0f9d63 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 10 Sep 2019 00:35:42 +0100 Subject: Fix listdir and caching of stats --- netfs/fuse/fuseDirs.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/netfs/fuse/fuseDirs.cpp b/netfs/fuse/fuseDirs.cpp index 58dab8e..5091d39 100644 --- a/netfs/fuse/fuseDirs.cpp +++ b/netfs/fuse/fuseDirs.cpp @@ -5,7 +5,7 @@ namespace NetFS { FuseApp::OpenDir::OpenDir(DirectoryPrxPtr r, std::string p) : remote(std::move(r)), - remoteV2(remote->ice_getFacet() >= "v02" ? Ice::uncheckedCast(r) : nullptr), + remoteV2(remote->ice_getFacet() >= "v02" ? Ice::uncheckedCast(remote) : nullptr), path(std::move(p)) { } @@ -51,12 +51,13 @@ FuseApp::readdir(const char * p, void * buf, fuse_fill_dir_t filler, off_t, stru try { auto od = getProxy(fi->fh); std::string path(p); - path += "/"; auto expiry = time(nullptr) + 2; if (fcr->ListDir && od->remoteV2) { for (const auto & e : od->remoteV2->listdir()) { filler(buf, e.first.c_str(), nullptr, 0); - statCache.add(path + e.first, converter.convert(e.second), expiry); + std::string k(path + e.first); + statCache.remove(k); + statCache.add(k, converter.convert(e.second), expiry); } } else { -- cgit v1.2.3