summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-09-06 00:16:30 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-09-06 00:16:30 +0100
commit615c32991893ee43f274f80535d04489dd71bf0a (patch)
treefb149a86cb788a37b7033a3826f0316babad0a59
parentSingle FUSE version definition (diff)
downloadnetfs-615c32991893ee43f274f80535d04489dd71bf0a.tar.bz2
netfs-615c32991893ee43f274f80535d04489dd71bf0a.tar.xz
netfs-615c32991893ee43f274f80535d04489dd71bf0a.zip
Support mapper rejection signalled by 0 st_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;