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

fix by_id not free when use_host_ino=true #189

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

zyfjeff
Copy link
Contributor

@zyfjeff zyfjeff commented Mar 26, 2024

When use_host_ino mode is turned on, we only need to save the by_id relationship if the host inode of the file is larger than MAX_HOST_INO, and don't remove it. however, the previous code used a virtual inode combining the host inode, dev, mnt, and other parts of the file, and this inode is a 56bit inode, which is always larger than MAX_HOST_INO, and so it resulted in the by_id relationship not being cleaned up.

@zyfjeff
Copy link
Contributor Author

zyfjeff commented Mar 26, 2024

New version of rust clippy bugs
rust-lang/rust-clippy#12560

@zyfjeff
Copy link
Contributor Author

zyfjeff commented Mar 26, 2024

Waiting for this #187 pr to be merged will solve the CI problem.

@@ -777,7 +777,7 @@ impl<S: BitmapSlice + Send + Sync> PassthroughFs<S> {
// We just removed the last refcount for this inode.
// The allocated inode number should be kept in the map when use_host_ino
// is false or inode is bigger than MAX_HOST_INO.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the comment as well? "inode" should refer to host inode or real inode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@imeoer
Copy link
Collaborator

imeoer commented Mar 27, 2024

cc @zyfjeff @eryugey rebasing the master branch will fix the broken CI.

When use_host_ino mode is turned on, we only need to save the by_id
relationship if the host inode of the file is larger than MAX_HOST_INO,
and don't remove it. however, the previous code used a virtual inode
combining the host inode, dev, mnt, and other parts of the file,
and this inode is a 56bit inode, which is always larger than MAX_HOST_INO,
and so it resulted in the by_id relationship not being cleaned up.

Signed-off-by: zyfjeff <[email protected]>
@eryugey eryugey merged commit 68df7ba into cloud-hypervisor:master Mar 27, 2024
10 checks passed
@zyfjeff zyfjeff deleted the fix-inode-leak branch March 27, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants