Skip to content

ROX-33199: unlink inode tracking#429

Open
ovalenti wants to merge 4 commits intomainfrom
ovalenti/unlink_inode_tracking
Open

ROX-33199: unlink inode tracking#429
ovalenti wants to merge 4 commits intomainfrom
ovalenti/unlink_inode_tracking

Conversation

@ovalenti
Copy link
Contributor

Description

When a file is unlinked, the corresponding inode should be removed from the kernel inode map and also from the inode->path map in userland.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why you did not do so. (Valid reasons include "CI is sufficient" or "No testable changes")
In addition to reviewing your code, reviewers must also review your testing instructions, and make sure they are sufficient.

For more details, ref the Confluence page about this section.

@ovalenti ovalenti self-assigned this Mar 25, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a358ede-80d5-4e25-8abd-308cfa9606e6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ovalenti/unlink_inode_tracking

Comment @coderabbitai help to get the list of available commands and usage tips.

@ovalenti ovalenti force-pushed the ovalenti/unlink_inode_tracking branch from 2b6011b to 2606352 Compare March 25, 2026 16:39
@ovalenti ovalenti force-pushed the ovalenti/unlink_inode_tracking branch from 2606352 to 807b2a9 Compare March 27, 2026 10:29
@ovalenti ovalenti marked this pull request as ready for review March 27, 2026 14:02
@ovalenti ovalenti requested a review from a team as a code owner March 27, 2026 14:02
Comment on lines 129 to +136
pub fn is_creation(&self) -> bool {
matches!(self.file, FileData::Creation(_))
}

pub fn is_unlink(&self) -> bool {
matches!(self.file, FileData::Unlink(_))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There has to be an idiomatic way of dispatching to a handling function depending on the type ; a match could be a way, but the is_creation() function wasn't going in that direction.

@Molter73 , what would you advise ?

Comment on lines +251 to +262
with open(original_file, 'w') as f:
f.write('This is a test')

# Create two hardlinks in the unmonitored directory
hardlink_file1 = os.path.join(ignored_dir, 'hardlink1.txt')
os.link(original_file, hardlink_file1)

hardlink_file2 = os.path.join(ignored_dir, 'hardlink2.txt')
os.link(original_file, hardlink_file2)

os.remove(hardlink_file1)
os.remove(hardlink_file2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to be flaky. The inode of the original file may not have landed in the probe's map before we start deleting.

I will split the test to wait for the CREATION event before going on with the unlinks.

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.

1 participant