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

fusedev: add clone_fuse_file method to FuseSession #177

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

loheagn
Copy link
Contributor

@loheagn loheagn commented Nov 15, 2023

This patch adds clone_fuse_file method to FuseSession.

This function obtains a new file descriptor by opening /dev/fuse and associates the file descriptor with the original fuse connection of fuse session using the ioctl FUSE_DEV_IOC_CLONE command.

@loheagn loheagn changed the title linux_session: add clone_fuse_file method to FuseSession fusedev: add clone_fuse_file method to FuseSession Nov 15, 2023
@loheagn
Copy link
Contributor Author

loheagn commented Nov 15, 2023

I try to use the following code to test this feature:

let dir = TempDir::new().unwrap();
let se = FuseSession::new(dir.as_path(), "foo", "bar", true);
assert!(se.is_ok());
let mut se = se.unwrap();
se.mount().unwrap();

but get CI error:

fusermount3: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf

Should I config the /etc/fuse.conf by modify the ci configuration files?

@bergwolf
Copy link
Contributor

@loheagn Could you explain a bit why you need it?

@loheagn
Copy link
Contributor Author

loheagn commented Nov 15, 2023

@loheagn Could you explain a bit why you need it?

As the comment discussed, clone fuse file can avoid blocking the IO requests when restarting nydusd.


#[test]
fn test_clone_fuse_file() {
let dir = TempDir::new().unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

let mut se = FuseSession::new(dir.as_path(), "foo", "bar", true).unwrap();?

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

@jiangliu
Copy link
Contributor

user_allow_other

We should do that:)

This patch adds  `clone_fuse_file` method to `FuseSession`. This function obtains a new file descriptor by opening `/dev/fuse` and associates the file descriptor with the original fuse connection of fuse session using the ioctl `FUSE_DEV_IOC_CLONE` command.

Signed-off-by: Nan Li <[email protected]>
@loheagn
Copy link
Contributor Author

loheagn commented Nov 15, 2023

user_allow_other

We should do that:)

@jiangliu Should I fix this in this patch?

@jiangliu
Copy link
Contributor

user_allow_other

We should do that:)

@jiangliu Should I fix this in this patch?

Please fix it:)

@jiangliu jiangliu merged commit d925e47 into cloud-hypervisor:master Nov 18, 2023
9 checks passed
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