summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netfs/fuse/fuseDirs.cpp11
-rw-r--r--netfs/fuse/fuseFiles.cpp2
2 files changed, 8 insertions, 5 deletions
diff --git a/netfs/fuse/fuseDirs.cpp b/netfs/fuse/fuseDirs.cpp
index c1a91bd..d23f5d7 100644
--- a/netfs/fuse/fuseDirs.cpp
+++ b/netfs/fuse/fuseDirs.cpp
@@ -50,13 +50,16 @@ namespace NetFS {
auto expiry = time(nullptr) + 2;
if (flags == FUSE_READDIR_PLUS) {
for (const auto & e : od->remote->listdir()) {
- filler(buf, e.first.c_str(), nullptr, 0, FUSE_FILL_DIR_PLUS);
- std::string k(path + e.first);
- statCache.remove(k);
- statCache.add(k, converter.convert(e.second), expiry);
+ if (auto stat = converter.convert(e.second); stat.st_mode) {
+ filler(buf, e.first.c_str(), nullptr, 0, FUSE_FILL_DIR_PLUS);
+ std::string k(path + e.first);
+ statCache.remove(k);
+ statCache.add(k, std::move(stat), expiry);
+ }
}
}
else {
+ // Standard read dir cannot know the local system cannot represent the inode
for (const auto & e : od->remote->readdir()) {
filler(buf, e.c_str(), nullptr, 0, (fuse_fill_dir_flags)0);
}
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp
index 0a59252..8014732 100644
--- a/netfs/fuse/fuseFiles.cpp
+++ b/netfs/fuse/fuseFiles.cpp
@@ -256,7 +256,7 @@ namespace NetFS {
*s = converter.convert(volume->getattr(reqEnv(), p));
}
}
- return 0;
+ return s->st_mode ? 0 : -ENOENT;
}
catch (SystemError & e) {
return -e.syserrno;