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

lib/vfscore: Fix warnings in automount.c #1398

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

keenox
Copy link

@keenox keenox commented Apr 28, 2024

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Application(s): nginx 1.25

Additional configuration

Description of changes

  • remove const from path in vfscore_mount_volume
  • use the device name for the message in uk_list_for_each_entry_reverse

- remove const from path in vfscore_mount_volume
- use the device name for the message in uk_list_for_each_entry_reverse

Signed-off-by: Radu Coriu <radu.gabrielc@gmail.com>
@keenox keenox requested a review from a team as a code owner April 28, 2024 11:16
@github-actions github-actions bot added area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/vfscore VFS Core Interface labels Apr 28, 2024
@StefanJum StefanJum requested review from StefanJum and removed request for a team April 28, 2024 11:18
@StefanJum StefanJum added this to the v0.17.0 (Calypso) milestone Apr 28, 2024
@@ -625,7 +628,7 @@ static int vfscore_ukopt_mkmp(char *path)
*/
static inline int vfscore_mount_volume(const struct vfscore_volume *vv)
{
const char *path;
char *path;
Copy link
Member

@skuenzer skuenzer Apr 29, 2024

Choose a reason for hiding this comment

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

What is the issue with const here? The path was treated as const on purpose because struct vfscore_volume is handed over as const as well so that we can support a const compiled-in filesystem table.

Copy link
Author

Choose a reason for hiding this comment

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

The path string is actually modified in vfscore_ukopt_mkmp at line 686. I initially wanted to strdup vv->path because of that constness promise in the input param, but after talking to @StefanJum we decided to only remove const.
Now I see that vv->path is also used at line 693 in vfscore_extract_volume, so don't know if a strdup would actually be ok and how the LIBVFSCORE_UKOPT_MKMP flag should interact with CONFIG_LIBUKCPIO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/vfscore VFS Core Interface
Projects
Status: 🏗 In Progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants