From f6e37672b83f5f7658f5e399418110e1e61ef96b Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 9 Feb 2021 18:09:28 -0500 Subject: [PATCH] reset dentry buffer when rewind'ed --- src/fuse_readdir_linux.cpp | 2 ++ src/fuse_readdir_plus_linux.cpp | 2 ++ src/fuse_readdir_plus_posix.cpp | 2 ++ src/fuse_readdir_posix.cpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/fuse_readdir_linux.cpp b/src/fuse_readdir_linux.cpp index 4d0cf062..f7eeeb4a 100644 --- a/src/fuse_readdir_linux.cpp +++ b/src/fuse_readdir_linux.cpp @@ -66,6 +66,8 @@ namespace l uint64_t namelen; struct linux_dirent64 *d; + fuse_dirents_reset(buf_); + buf = (char*)g_DENTS_BUF_POOL.alloc(); if(buf == NULL) return -ENOMEM; diff --git a/src/fuse_readdir_plus_linux.cpp b/src/fuse_readdir_plus_linux.cpp index ad643a5f..ef2e855d 100644 --- a/src/fuse_readdir_plus_linux.cpp +++ b/src/fuse_readdir_plus_linux.cpp @@ -70,6 +70,8 @@ namespace l fuse_entry_t entry; struct linux_dirent64 *d; + fuse_dirents_reset(buf_); + buf = (char*)g_DENTS_BUF_POOL.alloc(); entry.nodeid = 0; diff --git a/src/fuse_readdir_plus_posix.cpp b/src/fuse_readdir_plus_posix.cpp index 6f809684..27b6e07a 100644 --- a/src/fuse_readdir_plus_posix.cpp +++ b/src/fuse_readdir_plus_posix.cpp @@ -72,6 +72,8 @@ namespace l uint64_t namelen; fuse_entry_t entry; + fuse_dirents_reset(buf_); + entry.nodeid = 0; entry.generation = 0; entry.entry_valid = entry_timeout_; diff --git a/src/fuse_readdir_posix.cpp b/src/fuse_readdir_posix.cpp index ba944a83..b08f23e0 100644 --- a/src/fuse_readdir_posix.cpp +++ b/src/fuse_readdir_posix.cpp @@ -67,6 +67,8 @@ namespace l string fullpath; uint64_t namelen; + fuse_dirents_reset(buf_); + for(size_t i = 0, ei = branches_.size(); i != ei; i++) { int rv;