summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-10-26 07:26:55 +0000
committergVisor bot <gvisor-bot@google.com>2021-10-26 07:26:55 +0000
commit98b3fe457c69ebac5ac3a638902be621a03802b3 (patch)
tree8fa043a3c463f1d62a74431934190ae1fe7fd87e
parent4382f033feb58d3d1dcf8dbc84f94e0fbc8c1b0d (diff)
parent12480f1c4b49234a3761856e40d4d122695b610f (diff)
Merge release-20211019.0-36-g12480f1c4 (automated)
-rw-r--r--pkg/sentry/fsimpl/gofer/filesystem.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go
index 23c8b8ce3..bf58a9def 100644
--- a/pkg/sentry/fsimpl/gofer/filesystem.go
+++ b/pkg/sentry/fsimpl/gofer/filesystem.go
@@ -1696,7 +1696,7 @@ func (fs *filesystem) StatFSAt(ctx context.Context, rp *vfs.ResolvingPath) (linu
if err := d.controlFDLisa.StatFSTo(ctx, &statFS); err != nil {
return linux.Statfs{}, err
}
- if statFS.NameLength > maxFilenameLen {
+ if statFS.NameLength == 0 || statFS.NameLength > maxFilenameLen {
statFS.NameLength = maxFilenameLen
}
return linux.Statfs{
@@ -1705,6 +1705,7 @@ func (fs *filesystem) StatFSAt(ctx context.Context, rp *vfs.ResolvingPath) (linu
// something completely random, use a standard value.
Type: linux.V9FS_MAGIC,
BlockSize: statFS.BlockSize,
+ FragmentSize: statFS.BlockSize,
Blocks: statFS.Blocks,
BlocksFree: statFS.BlocksFree,
BlocksAvailable: statFS.BlocksAvailable,
@@ -1718,7 +1719,7 @@ func (fs *filesystem) StatFSAt(ctx context.Context, rp *vfs.ResolvingPath) (linu
return linux.Statfs{}, err
}
nameLen := uint64(fsstat.NameLength)
- if nameLen > maxFilenameLen {
+ if nameLen == 0 || nameLen > maxFilenameLen {
nameLen = maxFilenameLen
}
return linux.Statfs{
@@ -1727,6 +1728,7 @@ func (fs *filesystem) StatFSAt(ctx context.Context, rp *vfs.ResolvingPath) (linu
// something completely random, use a standard value.
Type: linux.V9FS_MAGIC,
BlockSize: int64(fsstat.BlockSize),
+ FragmentSize: int64(fsstat.BlockSize),
Blocks: fsstat.Blocks,
BlocksFree: fsstat.BlocksFree,
BlocksAvailable: fsstat.BlocksAvailable,