From 1c0ccce81e80292be5d4f333475b631996fc2cfd Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Thu, 9 Dec 2021 11:45:26 +0800 Subject: [PATCH] Fix potential metadata corrupt in Redis caused by gc --- pkg/meta/redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/meta/redis.go b/pkg/meta/redis.go index 5fd47bc7534d..ecf75cf5c7f4 100644 --- a/pkg/meta/redis.go +++ b/pkg/meta/redis.go @@ -2313,7 +2313,7 @@ func (r *redisMeta) cleanupLeakedInodes(delete bool) { var attr Attr r.parseAttr([]byte(v.(string)), &attr) ino, _ := strconv.Atoi(keys[i][1:]) - if _, ok := foundInodes[Ino(ino)]; !ok && time.Unix(attr.Atime, 0).Before(cutoff) { + if _, ok := foundInodes[Ino(ino)]; !ok && time.Unix(attr.Ctime, 0).Before(cutoff) { logger.Infof("found dangling inode: %s %+v", keys[i], attr) if delete { err = r.doDeleteSustainedInode(0, Ino(ino))