aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
authorMateusz Guzik <mjguzik@gmail.com>2026-04-21 20:25:36 +0200
committerChristian Brauner <brauner@kernel.org>2026-05-11 23:12:28 +0200
commit769e143b115a4af75ecbc6d4e39d58b3e6fe2099 (patch)
tree0a7f60cf4f5f39aca2505890e0f625abd715dff2 /security
parent254f49634ee16a731174d2ae34bc50bd5f45e731 (diff)
downloadlinux-next-history-769e143b115a4af75ecbc6d4e39d58b3e6fe2099.tar.gz
fs: add icount_read_once() and stop open-coding ->i_count loads
Similarly to inode_state_read_once(), it makes the caller spell out they acknowledge instability of the returned value. Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://patch.msgid.link/20260421182538.1215894-2-mjguzik@gmail.com Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/landlock/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/landlock/fs.c b/security/landlock/fs.c
index c1ecfe2390326..32d560f12dbd3 100644
--- a/security/landlock/fs.c
+++ b/security/landlock/fs.c
@@ -1278,7 +1278,7 @@ static void hook_sb_delete(struct super_block *const sb)
struct landlock_object *object;
/* Only handles referenced inodes. */
- if (!icount_read(inode))
+ if (!icount_read_once(inode))
continue;
/*