Fix walking to attach path logic in lisafs.

The attach path (if one exists) is always absolute. This is checked while
setting that option. strings.Split(aname, "/") creates an extra empty string in
the beginning of the slice. Exclude that while making Walk RPC.

PiperOrigin-RevId: 428046171
This commit is contained in:
Ayush Ranjan
2022-02-11 11:15:11 -08:00
committed by gVisor bot
parent aff71d4420
commit 697d3d52eb
+2 -2
View File
@@ -541,9 +541,9 @@ func (fs *filesystem) initClientLisa(ctx context.Context) (lisafs.Inode, error)
return rootInode, nil
}
// Walk to the attach point from root inode.
// Walk to the attach point from root inode. aname is always absolute.
rootFD := fs.clientLisa.NewFD(rootInode.ControlFD)
status, inodes, err := rootFD.WalkMultiple(ctx, strings.Split(fs.opts.aname, "/"))
status, inodes, err := rootFD.WalkMultiple(ctx, strings.Split(fs.opts.aname, "/")[1:])
rootFD.CloseBatched(ctx)
if err != nil {
return lisafs.Inode{}, err