@@ -474,7 +474,7 @@ func (n *layerDebugRoot) Lookup(ctx context.Context, name string) (fspkg.Node, e
474
474
te : root ,
475
475
sr : r ,
476
476
f : f ,
477
- children : make (map [string ]fspkg. Node ),
477
+ child : make (map [string ]* node ),
478
478
}, nil
479
479
}
480
480
@@ -776,7 +776,7 @@ func (n *layerHostOwnerImageReference) Lookup(ctx context.Context, name string)
776
776
fs : n .fs ,
777
777
te : root ,
778
778
sr : r ,
779
- children : make (map [string ]fspkg. Node ),
779
+ child : make (map [string ]* node ),
780
780
}, nil
781
781
}
782
782
@@ -903,7 +903,11 @@ type node struct {
903
903
te * stargz.TOCEntry
904
904
sr * stargz.Reader
905
905
f * os.File // non-nil if root & in debug mode
906
- children map [string ]fspkg.Node // Remenber child nodes once looked up.
906
+
907
+ // children maps from previously-looked up base names (like "foo.txt") to
908
+ // the *node that was previously returned. This prevents FUSE inode numbers
909
+ // from getting out of sync
910
+ child map [string ]* node
907
911
}
908
912
909
913
var (
@@ -969,7 +973,7 @@ func (h *nodeHandle) ReadDirAll(ctx context.Context) (ents []fuse.Dirent, err er
969
973
//
970
974
// See https://godoc.org/bazil.org/fuse/fs#NodeStringLookuper
971
975
func (n * node ) Lookup (ctx context.Context , name string ) (fspkg.Node , error ) {
972
- if c , ok := n .children [name ] ; ok {
976
+ if c , ok := n .child [name ] ; ok {
973
977
return c , nil
974
978
}
975
979
@@ -978,8 +982,13 @@ func (n *node) Lookup(ctx context.Context, name string) (fspkg.Node, error) {
978
982
return nil , fuse .ENOENT
979
983
}
980
984
981
- c := & node {n .fs , e , n .sr , nil , make (map [string ]fspkg.Node )}
982
- n .children [name ] = c
985
+ c := & node {
986
+ fs : n .fs ,
987
+ te : e ,
988
+ sr : n .sr ,
989
+ child : make (map [string ]* node ),
990
+ }
991
+ n .child [name ] = c
983
992
984
993
return c , nil
985
994
}
0 commit comments