diff --git a/pkg/meta/redis.go b/pkg/meta/redis.go index 99cb8dcbc806..e95ada5063ca 100644 --- a/pkg/meta/redis.go +++ b/pkg/meta/redis.go @@ -2206,6 +2206,10 @@ func (m *redisMeta) Read(ctx Context, inode Ino, indx uint32, slices *[]Slice) ( m.touchAtime(ctx, inode, nil) } }() + + if slices != nil { + *slices = nil + } f := m.of.find(inode) if f != nil { f.RLock() diff --git a/pkg/meta/sql.go b/pkg/meta/sql.go index c170fc660026..d33187214df4 100644 --- a/pkg/meta/sql.go +++ b/pkg/meta/sql.go @@ -35,12 +35,13 @@ import ( "syscall" "time" - "github.com/juicedata/juicefs/pkg/utils" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" "xorm.io/xorm" "xorm.io/xorm/log" "xorm.io/xorm/names" + + "github.com/juicedata/juicefs/pkg/utils" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) const MaxFieldsCountOfTable = 16 // node table @@ -2194,6 +2195,10 @@ func (m *dbMeta) Read(ctx Context, inode Ino, indx uint32, slices *[]Slice) (rer m.touchAtime(ctx, inode, nil) } }() + + if slices != nil { + *slices = nil + } f := m.of.find(inode) if f != nil { f.RLock() diff --git a/pkg/meta/tkv.go b/pkg/meta/tkv.go index 19f6902c3428..deee0eae6c7b 100644 --- a/pkg/meta/tkv.go +++ b/pkg/meta/tkv.go @@ -1891,6 +1891,10 @@ func (m *kvMeta) Read(ctx Context, inode Ino, indx uint32, slices *[]Slice) (rer m.touchAtime(ctx, inode, nil) } }() + + if slices != nil { + *slices = nil + } f := m.of.find(inode) if f != nil { f.RLock()