cherry-pick statx_permcheck for rhel10#154
Merged
hbirth merged 2 commits intoMay 25, 2026
Merged
Conversation
In preparation for allowing partial attribute updates via statx (where only a subset of STATX_BASIC_STATS may be requested and returned), modify fuse_change_attributes_common() to be more selective about what it updates. Currently, fuse_change_attributes_common() unconditionally: 1. Clears ALL of STATX_BASIC_STATS from inval_mask 2. Updates fi->i_time (extending the attribute timeout) For some fuse-servers it might be benefitial to reduce the number of queries attributes and and attribute mask is one of the features of statx. With the all or nothing handling of fuse_change_attributes_common() that statx feature is impossible to be used. This commit adds the logic to: 1. Track which attributes were actually returned (via sx->mask for statx, or assume all STATX_BASIC_STATS for getattr) 2. Only clear those specific attributes from inval_mask 3. Only update fi->i_time when it's safe: when cache_mask is empty OR when all cache_mask attributes were included in the response The condition in fuse_do_statx() still requires ALL STATX_BASIC_STATS, so this commit has no functional change. A follow up commit will relax that condition to enable partial updates. Signed-off-by: Bernd Schubert <bernd@bsbernd.com> (cherry picked from commit 8034f26)
…attributes For permission checks via inode_permission(), we only need mode, uid, and gid attributes. Previously, we requested all STATX_BASIC_STATS, which was inefficient. This commit enables the optimization by: 1. Requesting only STATX_MODE | STATX_UID | STATX_GID for permission checks 2. Relaxing the condition in fuse_do_statx() from requiring all basic stats to accepting any subset of basic stats 3. Adding validation that the server returns at least what was requested The preparation commit ensures partial updates work correctly by only updating returned attributes and managing timeouts appropriately. Signed-off-by: Bernd Schubert <bernd@bsbernd.com> (cherry picked from commit 09ed47b)
hbirth
approved these changes
May 25, 2026
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.
fuse: Prepare for partial statx updates by tracking returned attributes
(cherry picked from commit 8034f26)
fuse: Optimize statx for permission checks by requesting only needed attributes
cherry picked from commit 09ed47b