Skip to contentSkip to conversation

fs: assert ->i_lock held in __iget()

PATCH Applied Mateusz Guzik 3 participants 3 messages Sep 30, 2025 – Oct 6, 2025 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: assert ->i_lock held in __iget()

Also remove the now redundant comment.

---

verified this booted with ext4 on root, no splats

 include/linux/fs.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/fs.h +1 -3
index 9e9d7c757efe..4c773c4ee7aa 100644
@@ -3368,11 +3368,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);
 }
 
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mateusz Guzik

Also remove the now redundant comment.

Looks good. Feel free to add:

Honza

Quoted 27 lines

---

verified this booted with ext4 on root, no splats

 include/linux/fs.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/fs.h +1 -3
index 9e9d7c757efe..4c773c4ee7aa 100644
@@ -3368,11 +3368,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);
 }
 
Signature · 1 line
2.34.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer Applied
#2 lore raw
In reply to Mateusz Guzik
Quoted 3 lines · Mateusz Guzik

Also remove the now redundant comment.

Applied to the vfs-6.19.inode branch of the vfs/vfs.git tree. Patches in the vfs-6.19.inode branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.19.inode

[1/1] fs: assert ->i_lock held in __iget()

      https://git.kernel.org/vfs/vfs/c/0cb93842ce06