Skip to contentSkip to conversation

i_flags locking

DISCUSSION Jan Kara 2 participants 2 messages Jun 25, 2007 – Jun 30, 2007 VFS

lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

Hi,

I came across the following question: What is the proper locking for
using i_flags? I've noticed i_flags are read freely without any lock. The modifications I've seen e.g. in ext3 were done under i_mutex. Is this right?
BTW it means that when checking i_flags we can see intermediate states
in ext3_set_inode_flags() when all flags are cleared and the proper flags are not yet set, right?
I'm currently playing with something like inotify for subtree and I'd
need to modify i_flags but using i_mutex unpleasantly interferes with directory locking...

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs
#1 lore raw
Quoted 12 lines · Jan Kara

Hi,

I came across the following question: What is the proper locking for
using i_flags? I've noticed i_flags are read freely without any lock. The modifications I've seen e.g. in ext3 were done under i_mutex. Is this right?
BTW it means that when checking i_flags we can see intermediate states
in ext3_set_inode_flags() when all flags are cleared and the proper flags are not yet set, right?
I'm currently playing with something like inotify for subtree and I'd
need to modify i_flags but using i_mutex unpleasantly interferes with directory locking...

i_lock?