Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pkg/sentry/fsimpl/tmpfs/tmpfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ type filesystem struct {
maxSizeInPages uint64

// maxInodes is the maximum permissible number of inodes for the tmpfs.
// If maxInodes == 0, there is no limit on the number of inodes.
// This field is immutable.
maxInodes uint64

Expand Down Expand Up @@ -204,7 +205,7 @@ func getDefaultSizeLimit(disable bool) uint64 {

func getDefaultInodeLimit(disable bool) uint64 {
if disable {
return math.MaxInt64
return 0
}

return totalHostMem / hostarch.PageSize / 2
Expand Down Expand Up @@ -388,21 +389,18 @@ func (fstype FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virt
case linux.S_IFREG:
inode, err := fs.newRegularFile(rootKUID, rootKGID, rootMode, nil /* parentDir */)
if err != nil {
ctx.Warningf("failed to create tmpfs root file: %v", err)
return nil, nil, err
}
root = fs.newDentry(inode)
case linux.S_IFLNK:
inode, err := fs.newSymlink(rootKUID, rootKGID, rootMode, tmpfsOpts.RootSymlinkTarget, nil /* parentDir */)
if err != nil {
ctx.Warningf("failed to create tmpfs root symlink: %v", err)
return nil, nil, err
}
root = fs.newDentry(inode)
case linux.S_IFDIR:
dirInode, err := fs.newDirectory(rootKUID, rootKGID, rootMode, nil /* parentDir */)
if err != nil {
ctx.Warningf("failed to create tmpfs root directory: %v", err)
return nil, nil, err
}
root = &dirInode.dentry
Expand Down
Loading