i_flags locking
Jan Kara
reviewerHi,
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
Quoted 12 lines · Jan Kara
Hi,
I came across the following question: What is the proper locking for
usingi_flags? I've noticedi_flagsare read freely without any lock. The modifications I've seen e.g. in ext3 were done underi_mutex. Is this right?
BTW it means that when checkingi_flagswe can see intermediate states
inext3_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 modifyi_flagsbut usingi_mutexunpleasantly interferes with directory locking...
i_lock?