Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

virtiofs: fix virtiofs crash when cache=none#1924

Merged
jcvenegas merged 1 commit intokata-containers:masterfrom
ganeshmaharaj:vhost-fs-hotplug-cache-error
Aug 2, 2019
Merged

virtiofs: fix virtiofs crash when cache=none#1924
jcvenegas merged 1 commit intokata-containers:masterfrom
ganeshmaharaj:vhost-fs-hotplug-cache-error

Conversation

@ganeshmaharaj
Copy link
Copy Markdown
Contributor

When virtio_fs_cache is set to none, the mount options for the folder
inside the guest should not contain the dax option else it leads to
invalid address errors and a crash of the daemon on the host.

Fixes: #1907
Signed-off-by: Ganesh Maharaj Mahalingam ganesh.mahalingam@intel.com

Copy link
Copy Markdown

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kataVirtioFSDevType = "virtio-fs"
sharedDir9pOptions = []string{"trans=virtio,version=9p2000.L,cache=mmap", "nodev"}
sharedDirVirtioFSOptions = []string{"default_permissions,allow_other,rootmode=040000,user_id=0,group_id=0,tag=" + mountGuest9pTag, "nodev"}
sharedDirVirtioFSDaxOptions = "dax"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really hard to identify what was the change here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. I wish golang wouldn't keep moving every line to match every other line. The change is an one line addition.
sharedDirVirtioFSDaxOptions = "dax"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and remove dax from sharedDirVirtioFSOptions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh hehe.. yes.. 😜

When virtio_fs_cache is set to none, the mount options for the folder
inside the guest should not contain the dax option else it leads to
invalid address errors and a crash of the daemon on the host.

Fixes: kata-containers#1907
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
@ganeshmaharaj ganeshmaharaj force-pushed the vhost-fs-hotplug-cache-error branch from 1d70418 to 6e1e6a2 Compare August 1, 2019 20:26
@ganeshmaharaj
Copy link
Copy Markdown
Contributor Author

/test

Copy link
Copy Markdown

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ganeshmaharaj
Copy link
Copy Markdown
Contributor Author

@jcvenegas @devimc the initrd fails is the one a revert is going to fix, right?

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 1, 2019

Codecov Report

Merging #1924 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #1924      +/-   ##
==========================================
- Coverage   52.19%   52.19%   -0.01%     
==========================================
  Files         108      108              
  Lines       14196    14198       +2     
==========================================
+ Hits         7410     7411       +1     
- Misses       5907     5909       +2     
+ Partials      879      878       -1

// the guest directory can be mounted with option 'dax' allowing it to
// directly map contents from the host. When set to 'none', the mount
// options should not contain 'dax' lest the virtio-fs daemon crashing
// with an invalid address reference.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ganeshmaharaj Do we know why we get the invalid address reference?

Copy link
Copy Markdown
Contributor Author

@ganeshmaharaj ganeshmaharaj Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amshinde if I understand right, cause the guest thinks the memory region is shared between the host daemon and the guest and expects the host to know memory mapping to that region but the host process was started with cache=none and does not understand the translation.

@ganeshmaharaj
Copy link
Copy Markdown
Contributor Author

metrics CI seems to be failing with below error.

08:06:18 Error: Error downloading packages:
08:06:18   Curl error (16): Error in the HTTP2 framing layer for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f30&arch=x86_64 []
08:06:18 The command '/bin/sh -c dnf install -y qemu-img parted gdisk e2fsprogs gcc xfsprogs findutils' returned a non-zero code: 1

@chavafg any chance you have seen this in the recent past?

@chavafg
Copy link
Copy Markdown
Contributor

chavafg commented Aug 2, 2019

not really, maybe a network issue in the infra? I sent a restart, hopefully it doesn't fail this time

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VM stops when using virtio-fs and cache=none

5 participants