]> git.ipfire.org Git - thirdparty/linux.git/commit
f2fs: annotate lockless NAT counter reads
authorCen Zhang <zzzccc427@gmail.com>
Tue, 5 May 2026 12:55:10 +0000 (20:55 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:34 +0000 (19:52 +0000)
commitfb645a976f53b175a49bdf52cfcd2c56f4b1456a
treed9f3b02adc35369eb53b5450cc91dad4c514ced0
parentb952837f734c3a627877bf922408dac04588a643
f2fs: annotate lockless NAT counter reads

nat_cnt[] is updated while callers hold nat_tree_lock, but F2FS samples
the counters locklessly in f2fs_available_free_memory(),
excess_dirty_nats(), and excess_cached_nats(). Those helpers only steer
cache reclaim and background sync heuristics; they do not control NAT
entry lifetime or checkpoint correctness.

Document the intent with data_race(READ_ONCE()) and a short comment
instead of adding locking to the balance path.

Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c
fs/f2fs/node.h