Skip to content

Commit 34672d4

Browse files
committed
metadata/gc: remove the noop-loop for snapshot reference
The noop-loop does nothing. The containerd doesn't have any snapshotter buckets at the beginning. If user uses specific dir as rootfs to create container, and sets `snapshotter` key to the container, like `overlayfs` by mistake, the gc scheduler will try to scan the snapshotter and panic. In order to avoid this case, remove the noop-loop here. Signed-off-by: Wei Fu <[email protected]>
1 parent 9f705f4 commit 34672d4

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

metadata/gc.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node)
296296

297297
bkt := getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectSnapshots, []byte(ss), []byte(name))
298298
if bkt == nil {
299-
getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectSnapshots).ForEach(func(k, v []byte) error {
300-
return nil
301-
})
302-
303299
// Node may be created from dead edge
304300
return nil
305301
}

0 commit comments

Comments
 (0)