summaryrefslogtreecommitdiff
path: root/netfs/fuse/fuseDirs.cpp
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 /netfs/fuse/fuseDirs.cpp
parentSingle FUSE version definition (diff)
downloadnetfs-615c32991893ee43f274f80535d04489dd71bf0a.tar.bz2
netfs-615c32991893ee43f274f80535d04489dd71bf0a.tar.xz
netfs-615c32991893ee43f274f80535d04489dd71bf0a.zip
Support mapper rejection signalled by 0 st_mode
Diffstat (limited to 'netfs/fuse/fuseDirs.cpp')
-rw-r--r--netfs/fuse/fuseDirs.cpp11
1 files changed, 7 insertions, 4 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);
}