Skip to content

Commit 31a7e54

Browse files
committed
NFS: Correct timing for assigning access cache timestamp
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Chengen Du <[email protected]> commit 21fd9e8 When the user's login time is newer than the cache's timestamp, the original entry in the RB-tree will be replaced by a new entry. Currently, the timestamp is only set if the entry is not found in the RB-tree, which can cause the timestamp to be undefined when the entry exists. This may result in a significant increase in ACCESS operations if the timestamp is set to zero. Signed-off-by: Chengen Du <[email protected]> Fixes: 0eb4381 ("NFS: Clear the file access cache upon login”) Reviewed-by: Benjamin Coddington <[email protected]> Signed-off-by: Anna Schumaker <[email protected]> (cherry picked from commit 21fd9e8) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 04117cd commit 31a7e54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3040,7 +3040,6 @@ static void nfs_access_add_rbtree(struct inode *inode,
30403040
else
30413041
goto found;
30423042
}
3043-
set->timestamp = ktime_get_ns();
30443043
rb_link_node(&set->rb_node, parent, p);
30453044
rb_insert_color(&set->rb_node, root_node);
30463045
list_add_tail(&set->lru, &nfsi->access_cache_entry_lru);
@@ -3065,6 +3064,7 @@ void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set,
30653064
cache->fsgid = cred->fsgid;
30663065
cache->group_info = get_group_info(cred->group_info);
30673066
cache->mask = set->mask;
3067+
cache->timestamp = ktime_get_ns();
30683068

30693069
/* The above field assignments must be visible
30703070
* before this item appears on the lru. We cannot easily

0 commit comments

Comments
 (0)