Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kata-sys-util: fix issues where umount2 couldn't get the correct path #5873

Merged
merged 1 commit into from Dec 13, 2022

Conversation

justxuewei
Copy link
Member

@justxuewei justxuewei commented Dec 9, 2022

Strings in Rust don't have \0 at the end, but C does, which leads to umount2
in the libc can't get the correct path. Besides, calling nix::mount::umount2
to avoid using an unsafe block is a robust solution.

Fixes: #5871

Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com

@katacontainersbot
Copy link
Contributor

Can one of the admins verify this patch?

@justxuewei
Copy link
Member Author

@lifupan @jiangliu @liubin @bergwolf PTAL, thanks.

@justxuewei justxuewei changed the title kata-sys-util: fix issues where umount2 couldn't get correct path kata-sys-util: fix issues where umount2 couldn't get the correct path Dec 12, 2022
Copy link
Member

@bergwolf bergwolf left a comment

Choose a reason for hiding this comment

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

lgtm!

@bergwolf
Copy link
Member

/test

Strings in Rust don't have \0 at the end, but C does, which leads to `umount2`
in the libc can't get the correct path. Besides, calling `nix::mount::umount2`
to avoid using an unsafe block is a robust solution.

Fixes: kata-containers#5871

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
@lifupan
Copy link
Member

lifupan commented Dec 12, 2022

/test

@lifupan
Copy link
Member

lifupan commented Dec 12, 2022

/retest

@liubin
Copy link
Member

liubin commented Dec 13, 2022

/test-ubuntu-metrics

1 similar comment
@lifupan
Copy link
Member

lifupan commented Dec 13, 2022

/test-ubuntu-metrics

@lifupan lifupan added no-backport-needed Changed do not need to be applied to an older branch / repository no-forward-port-needed Changed do not need to be applied to a newer branch / repository labels Dec 13, 2022
@lifupan lifupan merged commit 015674d into kata-containers:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport-needed Changed do not need to be applied to an older branch / repository no-forward-port-needed Changed do not need to be applied to a newer branch / repository size/small Small and simple task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kata-sys-util: umounting by umount2 encounters "no such a file or directory" issue
5 participants