fix: race condition for device error propagation#620
Open
madjesc wants to merge 1 commit into
Open
Conversation
madjesc
force-pushed
the
fix/unified-race-condition
branch
from
June 22, 2026 16:47
befb20a to
c0aeabf
Compare
amissael95
requested changes
Jul 15, 2026
amissael95
left a comment
Contributor
There was a problem hiding this comment.
Thanks for you efforts and working in this change. Leaving a couple of comments. Please ensure the fix is tested and documented in this PR properly.
madjesc
force-pushed
the
fix/unified-race-condition
branch
from
July 16, 2026 19:03
c0aeabf to
6a00127
Compare
amissael95
reviewed
Jul 16, 2026
| ltfs_mutex_unlock(&vol->device->read_only_flag_mutex); | ||
| } | ||
|
|
||
| if (update_vollock) { |
Contributor
There was a problem hiding this comment.
Why are you removing these lines? Looks like you do not longer want to set the volstat value, do you plan to set this values from somewhere else?
fix: NO_SENSE errortype when it should be backwards fix: unified simple problems
madjesc
force-pushed
the
fix/unified-race-condition
branch
from
July 22, 2026 17:46
6a00127 to
0f0a343
Compare
Piloalucard
reviewed
Jul 22, 2026
| */ | ||
|
|
||
| #include "libltfs/ltfs.h" | ||
| #include "libltfs/ltfs_locking_old.h" |
Member
There was a problem hiding this comment.
Is this header necessary? I see deletions only in this file
Piloalucard
reviewed
Jul 22, 2026
| ret = size; | ||
| if (ret < 0) { | ||
| if (IS_WRITE_PERM(-ret)) { | ||
| mam_lockval vollock = d->matches_name_criteria ? PWE_MAM_IP : PWE_MAM_DP; |
Member
There was a problem hiding this comment.
Is this the best way to obtain the Partition to lock?
I also see we do not mantain the PWE_MAM_BOTH logic in case a PWE is already present in a partition, this could not lead to problems on analysis?
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.
fix: file backend NO_SENSE errortype when it should be backwards
fix: unified simple problems
Changelog
Fixed
Race Condition in Device Error Propagation
iosched.cto prevent inconsistent error states across multiple code pathsError Type Correction in File Debug Driver
filedebug_tc.cwhereNO_SENSEandWRITE_PERMerror types were reversedEDEV_WRITE_PERMwhenforce_errortypeis set, andEDEV_NO_SENSEotherwiseWrite Permission Error Handling
Changed
Code Refactoring
_unified_write_index_after_permfunction fromunified.ctoiosched.cas_iosched_write_index_after_permltfs_fsops_writefunctionError Handling Architecture
ltfs_write_indexfunctionAdded
New Error Checking Macro
IS_RW_PERMmacro inltfs_error.hfor checking read/write permission errorsChecklist: