Skip to content

added support for fs_context operations -> parse_param#85

Merged
jserv merged 7 commits intosysprog21:masterfrom
EricKim27:master
May 7, 2026
Merged

added support for fs_context operations -> parse_param#85
jserv merged 7 commits intosysprog21:masterfrom
EricKim27:master

Conversation

@EricKim27
Copy link
Copy Markdown
Contributor

@EricKim27 EricKim27 commented May 5, 2026

This commit implements the fs_context_operations->parse_param(replacement for parse_options used at fill_super for kernels below 6.18) and modifies other related functions to work with the newly implemented operation.


Summary by cubic

Add fs_context-based mount option parsing for kernels 6.18+, adding parse_param for journal_dev and journal_path, with proper context cleanup and journal loading. Legacy parse_options remains for older kernels.

  • New Features

    • Implemented simplefs_parse_param using fs_parameter_spec/fs_parse for journal_dev (u32) and journal_path (string).
    • Added per-mount simplefs_fs_context; allocated in .init_fs_context, stored in fc->fs_private, and exposed via .parameters = &simplefs_param_specs.
    • In simplefs_fill_super (>=6.18), load the journal from journal_dev or resolve journal_path with kern_path and load if it’s a block device.
  • Bug Fixes

    • Added .free in fs_context_operations to free journal_path and the context; free any existing journal_path before kstrdup() in parse_param.
    • Reordered path_put() to occur after d_inode() extraction (>=6.18) and after device checks in the legacy path to prevent a possible use-after-free.

Written for commit e60949b. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="super.c">

<violation number="1" location="super.c:705">
P2: Missing path_put() after kern_path() leaks the looked-up path reference in the new journal_path fs_context path.</violation>
</file>

<file name="fs.c">

<violation number="1" location="fs.c:25">
P2: Allocated fs_context private data has no cleanup callback, so the mount context can leak when the fs_context is destroyed.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread super.c
Comment thread fs.c
cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv jserv merged commit 3562a0b into sysprog21:master May 7, 2026
4 checks passed
@jserv
Copy link
Copy Markdown
Collaborator

jserv commented May 7, 2026

Thank @EricKim27 for contributing!

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