diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-03-04 11:28:31 +0100 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-03-06 11:06:15 +0100 |
commit | 8019ad13ef7f64be44d4f892af9c840179009254 (patch) | |
tree | 889b754b07fa844410d6782bc1b4473007a9bc99 /include/linux/fs.h | |
parent | 98d54f81e36ba3bf92172791eba5ca5bd813989b (diff) | |
download | lwn-8019ad13ef7f64be44d4f892af9c840179009254.tar.gz lwn-8019ad13ef7f64be44d4f892af9c840179009254.zip |
futex: Fix inode life-time issue
As reported by Jann, ihold() does not in fact guarantee inode
persistence. And instead of making it so, replace the usage of inode
pointers with a per boot, machine wide, unique inode identifier.
This sequence number is global, but shared (file backed) futexes are
rare enough that this should not become a performance issue.
Reported-by: Jann Horn <jannh@google.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3cd4fe6b845e..abedbffe2c9e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -698,6 +698,7 @@ struct inode { struct rcu_head i_rcu; }; atomic64_t i_version; + atomic64_t i_sequence; /* see futex */ atomic_t i_count; atomic_t i_dio_count; atomic_t i_writecount; |