Skip to content

fix: OpenFile::read_at no longer errors on invalid offset or length#331

Merged
simonsan merged 4 commits intomainfrom
fix-readfile
Oct 14, 2024
Merged

fix: OpenFile::read_at no longer errors on invalid offset or length#331
simonsan merged 4 commits intomainfrom
fix-readfile

Conversation

@aawsome
Copy link
Copy Markdown
Member

@aawsome aawsome commented Oct 13, 2024

This is needed if weired access to the OpenFile is made. This is e.g. the case for the mount command.

Also the docu of the affected methods has been clarified.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.4%. Comparing base (2b32031) to head (e17f998).
Report is 2 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
crates/core/src/repository.rs 48.6% <ø> (+0.4%) ⬆️
crates/core/src/vfs.rs 15.0% <100.0%> (+15.0%) ⬆️
crates/core/tests/integration.rs 87.5% <ø> (ø)

... and 12 files with indirect coverage changes

@aawsome aawsome added the S-waiting-for-review Status: PRs waiting for review label Oct 13, 2024
@simonsan simonsan added this pull request to the merge queue Oct 14, 2024
@simonsan simonsan added C-bug Category: Something isn't working as expected and removed S-waiting-for-review Status: PRs waiting for review labels Oct 14, 2024
Merged via the queue into main with commit c9c4285 Oct 14, 2024
@simonsan simonsan deleted the fix-readfile branch October 14, 2024 22:04
@rustic-release-plz rustic-release-plz bot mentioned this pull request Oct 14, 2024
github-merge-queue bot pushed a commit that referenced this pull request Oct 24, 2024
## 🤖 New release
* `rustic_backend`: 0.4.1 -> 0.4.2 (✓ API compatible changes)
* `rustic_core`: 0.5.3 -> 0.5.4 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `rustic_backend`
<blockquote>

##
[0.4.2](rustic_backend-v0.4.1...rustic_backend-v0.4.2)
- 2024-10-24

### Fixed

- fix opendal paths on windows
([#340](#340))
</blockquote>

## `rustic_core`
<blockquote>

##
[0.5.4](rustic_core-v0.5.3...rustic_core-v0.5.4)
- 2024-10-24

### Added

- *(commands)* Add convenient names for read-data-subset n/m
([#328](#328))

### Fixed

- OpenFile::read_at no longer errors on invalid offset or length
([#331](#331))

### Other

- *(deps)* update actions
([#338](#338))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: rustic-release-plz[bot] <182542030+rustic-release-plz[bot]@users.noreply.github.com>
github-merge-queue bot pushed a commit to rustic-rs/rustic that referenced this pull request Nov 10, 2024
This PR adds the `mount` command to rustic to access snapshot contents
as a read-only filesystem when the feature-flag `mount` is chosen.

As for the `webdav` command, there are following options:
- Access to a concrete snapshot/path, e.g. `rustic mount /mnt
37a63e5b:/my/path`.
- Access to all snapshots (maybe restricted by filters) by using
templates to define a virtual directory structure where snapshots are
located. Example: `rustic mount /mnt --path-template
"[{hostname}]/[{label}]/{time}" --time-template "%Y-%m-%d_%H-%M-%S"`
(these are also defined as default). Note that for all dirs containing
only snapshots, also a `latest` entry is generated. `latest` and
identical subsequent snapshots are symlinks when using `mount`.

This PR uses fuse_mt which is not optimal as it introduces some overhead
(e.g. needs to save whole Paths in-memory).

Note: Requires rustic-rs/rustic_core#331 to
properly show all data of files (without it builds and runs, but files
are truncated and return error when reading).

Note: Building with the `mount` feature flag requires special
dependencies and is only possible on supported platforms, see
https://github.com/cberner/fuser

closes #971

---------

Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants