Repository navigation
fix(files): map files on filesystems that cannot lock - #1965
Merged
Merged
Conversation
read_file_mapped treated every try_lock_shared error as a lock held by another process. The Flatpak document portal answers flock with ENOSYS, so no file opened through it could be mapped. Thumbnails then decoded the full raw instead of the embedded preview, and as_shot_white_balance fell back to the D65 reference, which moved the baseline of the white balance sliders and picker. Only WouldBlock counts as locked now.
Owner
|
LGTM, thanks so much! |
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.
Description
Under Flatpak, RapidRAW opens folders through the document portal, and
flockthere returnsENOSYS.read_file_mappedtreats everytry_lock_sharederror as a lock held by another process, so no file opened through the portal can be mapped, and the log showsFile is lockedfor each one. Every caller then falls back:as_shot_white_balancereturns the D65 reference, so the temperature and tint sliders and the picker start from the wrong baseline.The Flathub build has no filesystem permission, so this affects every Flathub user.
flatpak override --filesystem=<folder>works around it today.Type of Change
Changes Made
read_file_mappedcounts onlyTryLockError::WouldBlockas locked. Any other lock error, such as a filesystem that cannot lock, maps the file unlocked.Screenshots/Videos
None. The change shows in the log.
Testing
Test Configuration:
Before, every RAF logged
File is lockedand each thumbnail decoded the full raw. After, the same folder logged no lock warnings and built 505 thumbnails from the embedded previews, each in milliseconds.Checklist
Additional Notes
This is independent of #1960 and applies on its own.
AI Disclaimer:
Please state the involvement of AI in this PR: