From 64c0561faf1906ce988d3e0a867a8a29bd6449c5 Mon Sep 17 00:00:00 2001 From: jiefenghuang Date: Mon, 30 Sep 2024 10:50:54 +0800 Subject: [PATCH] reset if offset rewind Signed-off-by: jiefenghuang --- pkg/vfs/vfs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/vfs/vfs.go b/pkg/vfs/vfs.go index 958471726beb..87a614c70815 100644 --- a/pkg/vfs/vfs.go +++ b/pkg/vfs/vfs.go @@ -424,7 +424,11 @@ func (v *VFS) Readdir(ctx Context, ino Ino, size uint32, off int, fh uint64, plu h.Lock() defer h.Unlock() - if h.dirStream == nil { + if h.dirStream == nil || off == 0 { + if h.dirStream != nil { + h.dirStream.Close() + h.dirStream = nil + } var initEntries []*meta.Entry if ino == rootID && !v.Conf.HideInternal { for _, node := range internalNodes[1:] {