cherry-pick statx_permcheck for rhel9.6#157
Conversation
|
looks like this has some compile issues fs/fuse/inode.c: In function 'fuse_change_attributes_common_sx': |
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)
91e3a26 to
f8a66b0
Compare
hbirth
left a comment
There was a problem hiding this comment.
LGTM ... this is a cherry pick
No description provided.