Repository navigation
mount: add strip_components, numeric_ids and archive_dir_format mount options, fixes #4880 - #10505
Open
ThomasWaldmann wants to merge 3 commits into
Open
ThomasWaldmann wants to merge 3 commits into
ThomasWaldmann wants to merge 3 commits into
Conversation
fstab and autofs entries can only give mount options, not borg CLI options, so -o strip_components=N now does what --strip-components N does (the mount option wins if both are given). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like strip_components, this makes --numeric-ids usable from fstab and autofs entries. Also clarify in the docs that numeric-ids was the --numeric-ids CLI option, not a mount option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10505 +/- ##
==========================================
+ Coverage 89.12% 89.13% +0.01%
==========================================
Files 103 103
Lines 19783 19793 +10
Branches 3099 3102 +3
==========================================
+ Hits 17631 17642 +11
+ Misses 1490 1488 -2
- Partials 662 663 +1 ☔ View full report in Codecov by Harness. |
Contributor
|
It might be a good addition to also support |
Same as BORG_MOUNT_ARCHIVE_DIR_FORMAT, but usable from fstab and autofs entries; if both are given, the mount option is used. As mount options are separated by commas, the format can not contain a comma. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fstab and autofs entries (
fuse.borgfs) can only give mount options (-o ...), not borg CLI options or environment variables. Until now,strip_components=Nin such an entry was passed on to libfuse, which rejects unknown options, so the mount failed. In borg 2, the only workarounds were themount:section of the config file (applies to all borgfs mounts) orBORG_STRIP_COMPONENTS(no way to set it from autofs / mount(8)).Three commits:
strip_components=NUMBERmount option: same as--strip-components NUMBER, also feeds the item filter (skipping too-short paths). The mount option wins if both are given. Fixes mount: support strip-components #4880.numeric_idsmount option: same as--numeric-ids;numeric_ids=nooverrides the CLI flag. Also clarifies the docs, which said "usingnumeric-ids" although that was only the CLI flag.archive_dir_format=FORMATmount option: same asBORG_MOUNT_ARCHIVE_DIR_FORMAT; the mount option wins if both are given. Errors name the source (archive_dir_format mount option: ...vs.BORG_MOUNT_ARCHIVE_DIR_FORMAT: ...). As mount options are separated by commas, FORMAT can not contain a comma (documented).borg webdavkeeps using the env var.All three options are removed from the option list before it is passed to libfuse.
Tests:
parse_mount_options()unit tests invfs_test.py(no FUSE needed), plus a mount option case intest_fuse_archive_dir_format(mount option set while the env var is also set). Also checked thatborgfs /repo mnt -o ro,allow_other,strip_components=4,numeric_idshands onlyro,allow_other(plus borg's defaults) to libfuse, and ranArchiveVFS.create_filesystem()on a test repo with env only / mount option + env / invalid formats from either source.🤖 Generated with Claude Code