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

tarfs reliability fixes #160

Merged
merged 7 commits into from
Feb 13, 2024
Merged

tarfs reliability fixes #160

merged 7 commits into from
Feb 13, 2024

Conversation

wedsonaf
Copy link

@wedsonaf wedsonaf commented Feb 9, 2024

Merge Checklist
  • Followed patch format from upstream recommendation: https://github.com/kata-containers/community/blob/main/CONTRIBUTING.md#patch-format
    • Included a single commit in a given PR - at least unless there are related commits and each makes sense as a change on its own.
  • Aware about the PR to be merged using "create a merge commit" rather than "squash and merge" (or similar)
  • The upstream-missing label (or upstream-not-needed) has been set on the PR.
Summary

Fixes related to rarely exercised paths like failure or partial failure paths, tiny block devices (e.g., size of a single sector), corrupted images, etc.

Upstreaming to kata-containers is not necessary because we are hosting this in a different repo.

Test Methodology

Built the kernel module locally in 5.15 and 6.1 kernels, booted an image with busybox, loaded the module, mounted a tarfs file system and used it.

If we don't keep it up to date, d_off will be incorrect, so callers
will seek to the wrong position if they ever try to use d_off.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
If we run into an error while listing the contents of a directory, don't
fail the whole request if we already emitted at least one entry.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Without this, the lock would stay locked indefinitely.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
These checks will never trigger for valid images but they are useful
when dealing with corrupted or malicious images: although not strictly
necessary as block devices should reject such read attempts, having them
is a good security-in-depth approach because it protects the block
layer.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
This the right function to call on failure because it unhashes the
inode, which will cause any waiters (e.g., callers of ilookup or
iget_locked) to retry after waiting for inode init to complete.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
This check ensures that the expression below to determine the superblock
position won't underflow.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
When a mounted filesystem needs memory that isn't available, this flag
instructs the kernel allocator to not request (and wait for) file
systems to shrink caches because it may lead to deadlocks.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
@wedsonaf wedsonaf added the upstream/not-needed PRs that will not be upstreamed (e.g. internal) label Feb 9, 2024
@wedsonaf wedsonaf requested review from a team as code owners February 9, 2024 14:42
Copy link

@ms-mahuber ms-mahuber left a comment

Choose a reason for hiding this comment

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

Pending CI results

@ms-mahuber ms-mahuber merged commit 0c12c64 into msft-main Feb 13, 2024
44 of 56 checks passed
@malt3
Copy link

malt3 commented Apr 29, 2024

Should this patch set be added here or is that just a historical archive?

@miz060
Copy link
Member

miz060 commented Apr 29, 2024

Should this patch set be added here or is that just a historical archive?

Hey Malte,

That’s our archive upstream tarfs repo which hasn’t been updated recently. @wedsonaf is actively involved in the process of upstreaming the tarfs module to the main Linux kernel.

For the most recent updates and fixes to tarfs, we always push them to the msft-main branch for internal testing first.

sprt pushed a commit that referenced this pull request Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream/not-needed PRs that will not be upstreamed (e.g. internal)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants