]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: assert ->i_lock held in __iget()
authorMateusz Guzik <mjguzik@gmail.com>
Tue, 30 Sep 2025 23:53:14 +0000 (01:53 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 20 Oct 2025 18:22:25 +0000 (20:22 +0200)
Also remove the now redundant comment.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/fs.h

index c895146c1444be36e0a779df55622cc38c9419ff..ac62b9d10b00e5c8ea002de97078f0fc7a367a4e 100644 (file)
@@ -3378,11 +3378,9 @@ static inline bool is_zero_ino(ino_t ino)
        return (u32)ino == 0;
 }
 
-/*
- * inode->i_lock must be held
- */
 static inline void __iget(struct inode *inode)
 {
+       lockdep_assert_held(&inode->i_lock);
        atomic_inc(&inode->i_count);
 }