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

Create directory for mount target provided in configuration file #1378

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

asvrada
Copy link
Collaborator

@asvrada asvrada commented Jun 27, 2022

When using config.json to specify mount information, create target folders if they do not exist.

@asvrada asvrada force-pushed the fix_mount branch 2 times, most recently from 201d3f2 to e1ee3c1 Compare June 28, 2022 20:10
kernel/enter.c Outdated

if (errornum == -ENOENT)
// target do not exist, create directory
ECHECK(myst_syscall_mkdir(locals->suffix.buf, 0777));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't locals->suffix a path relative to where the filesystem to which target belongs is mounted?

Copy link
Collaborator

Choose a reason for hiding this comment

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

For the case where target belongs to rootfs it doesn't make a difference. But if the target(say /mnt/target) is on a filesystem mounted at some path(say /mnt). Then myst_mount_resolve will return just /target as the suffix.

Why don't you directly use normalized_target here?

Copy link
Collaborator

@vtikoo vtikoo left a comment

Choose a reason for hiding this comment

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

Looks good!

@asvrada asvrada merged commit d6fbd7e into deislabs:main Jul 7, 2022
@asvrada asvrada deleted the fix_mount branch July 7, 2022 04:52
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.

2 participants