diff options
author | Haibo Xu <haibo.xu@arm.com> | 2019-10-24 03:18:18 +0000 |
---|---|---|
committer | Haibo Xu <haibo.xu@arm.com> | 2019-10-28 05:56:03 +0000 |
commit | dec831b4939a6332cac5d186a604ff2cbbcaf7af (patch) | |
tree | 4a54ef7ac020e27a4967c047040c189ea481ef5a | |
parent | 1c480abc39b9957606ff8bf125a5c253ad8a76cb (diff) |
Cast the Stat_t.Nlink to uint64 on arm64.
Since the syscall.Stat_t.Nlink is defined as different types on
amd64 and arm64(uint64 and uint32 respectively), we need to cast
them to a unified uint64 type in gVisor code.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I7542b99b195c708f3fc49b1cbe6adebdd2f6e96b
-rw-r--r-- | pkg/p9/p9.go | 2 | ||||
-rw-r--r-- | runsc/fsgofer/fsgofer.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/p9/p9.go b/pkg/p9/p9.go index 25530adca..6039f5a42 100644 --- a/pkg/p9/p9.go +++ b/pkg/p9/p9.go @@ -814,7 +814,7 @@ func StatToAttr(s *syscall.Stat_t, req AttrMask) (Attr, AttrMask) { attr.Mode = FileMode(s.Mode) } if req.NLink { - attr.NLink = s.Nlink + attr.NLink = uint64(s.Nlink) } if req.UID { attr.UID = UID(s.Uid) diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go index 3fceecb3d..18b853e2e 100644 --- a/runsc/fsgofer/fsgofer.go +++ b/runsc/fsgofer/fsgofer.go @@ -601,7 +601,7 @@ func (l *localFile) GetAttr(_ p9.AttrMask) (p9.QID, p9.AttrMask, p9.Attr, error) Mode: p9.FileMode(stat.Mode), UID: p9.UID(stat.Uid), GID: p9.GID(stat.Gid), - NLink: stat.Nlink, + NLink: uint64(stat.Nlink), RDev: stat.Rdev, Size: uint64(stat.Size), BlockSize: uint64(stat.Blksize), |