Commit 89ab57eb authored by Ramon Nou's avatar Ramon Nou
Browse files

fix(client): restrict synthetic dentry cache metadata to directories

parent 62f20673
Loading
Loading
Loading
Loading
Loading
+4 −9
Changes for src/client/preload_util.cpp: 4 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -335,15 +335,10 @@ get_metadata(const string& path, bool follow_links, bool include_inline) {
            auto filename = p.filename().string();
            auto cache_entry = CTX->dentry_cache()->get(parent, filename);
            if(cache_entry &&
               cache_entry->file_type != gkfs::filemap::FileType::symlink) {
                LOG(DEBUG, "{}(): Dentry cache hit for file '{}'", __func__,
                    path);
                // if cache_entry exists, generate a Metadata object from it.
                mode_t mode = gkfs::config::syscall::stat::file_mode_default;
                if(cache_entry->file_type ==
                   gkfs::filemap::FileType::directory) {
                    mode = gkfs::config::syscall::stat::dir_mode_default;
                }
               cache_entry->file_type == gkfs::filemap::FileType::directory) {
                LOG(DEBUG, "{}(): Dentry cache hit for directory '{}'",
                    __func__, path);
                mode_t mode = gkfs::config::syscall::stat::dir_mode_default;
                gkfs::metadata::Metadata md{};
                md.mode(mode);
                md.ctime(cache_entry->ctime);