Skip to content

fix: ratime and rnostrictatime mount options failing with EINVAL#3467

Open
kechigon wants to merge 2 commits intoyouki-dev:mainfrom
kechigon:fix_issue_3399
Open

fix: ratime and rnostrictatime mount options failing with EINVAL#3467
kechigon wants to merge 2 commits intoyouki-dev:mainfrom
kechigon:fix_issue_3399

Conversation

@kechigon
Copy link
Copy Markdown

@kechigon kechigon commented Mar 22, 2026

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)

Related Issues

Related #3399

Additional Context

@kechigon
Copy link
Copy Markdown
Author

Todo: Create or update the corresponding unit tests within the modified module.

@saku3 saku3 added the kind/bug label Mar 22, 2026
@kechigon kechigon marked this pull request as ready for review March 29, 2026 05:17
Signed-off-by: Keigo Kurita <keig0xurita@gmail.com>
Signed-off-by: Keigo Kurita <keig0xurita@gmail.com>
Copy link
Copy Markdown
Member

@saku3 saku3 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

I left some comments, so could you please take a look?

Also, would it be possible to add an e2e test as well?

Please refer to the following README:

https://github.com/youki-dev/youki/tree/main/tests/contest/contest

I think it should be sufficient to add ratime and rnostrictatime cases to the existing mount_setattr test cases.

https://github.com/youki-dev/youki/blob/main/tests/contest/contest/src/tests/mounts_recursive/mod.rs

if let Some(mount_attr) = &mut mount_attr {
if is_clear {
mount_attr.attr_clr |= flag;
if flag != 0 && flag & linux::MOUNT_ATTR__ATIME == flag {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be better to align this with runc’s implementation.

In other words, rnorelatime should be treated as the recursive form of “clear relatime”.
I do not think we need to make the low-level runtime more complex by handling it as a no-op and skipping it there.

That would also allow us to consolidate the if logic the way runc does.

https://github.com/lifubang/runc/blob/main/libcontainer/specconv/spec_linux.go#L1168

}

#[test]
fn test_parse_mount_atime_set_includes_full_atime_mask_in_attr_clr() -> Result<()> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the rnoatime and rstrictatime tests should be split into separate test cases.

@kechigon
Copy link
Copy Markdown
Author

kechigon commented Apr 6, 2026

We have decided not to implement end-to-end testing on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants