diff options
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index c934689043b2..f50b434756c1 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -212,7 +212,7 @@ struct futex_pi_state { | |||
212 | atomic_t refcount; | 212 | atomic_t refcount; |
213 | 213 | ||
214 | union futex_key key; | 214 | union futex_key key; |
215 | }; | 215 | } __randomize_layout; |
216 | 216 | ||
217 | /** | 217 | /** |
218 | * struct futex_q - The hashed futex queue entry, one per waiting task | 218 | * struct futex_q - The hashed futex queue entry, one per waiting task |
@@ -246,7 +246,7 @@ struct futex_q { | |||
246 | struct rt_mutex_waiter *rt_waiter; | 246 | struct rt_mutex_waiter *rt_waiter; |
247 | union futex_key *requeue_pi_key; | 247 | union futex_key *requeue_pi_key; |
248 | u32 bitset; | 248 | u32 bitset; |
249 | }; | 249 | } __randomize_layout; |
250 | 250 | ||
251 | static const struct futex_q futex_q_init = { | 251 | static const struct futex_q futex_q_init = { |
252 | /* list gets initialized in queue_me()*/ | 252 | /* list gets initialized in queue_me()*/ |
@@ -670,13 +670,14 @@ again: | |||
670 | * this reference was taken by ihold under the page lock | 670 | * this reference was taken by ihold under the page lock |
671 | * pinning the inode in place so i_lock was unnecessary. The | 671 | * pinning the inode in place so i_lock was unnecessary. The |
672 | * only way for this check to fail is if the inode was | 672 | * only way for this check to fail is if the inode was |
673 | * truncated in parallel so warn for now if this happens. | 673 | * truncated in parallel which is almost certainly an |
674 | * application bug. In such a case, just retry. | ||
674 | * | 675 | * |
675 | * We are not calling into get_futex_key_refs() in file-backed | 676 | * We are not calling into get_futex_key_refs() in file-backed |
676 | * cases, therefore a successful atomic_inc return below will | 677 | * cases, therefore a successful atomic_inc return below will |
677 | * guarantee that get_futex_key() will still imply smp_mb(); (B). | 678 | * guarantee that get_futex_key() will still imply smp_mb(); (B). |
678 | */ | 679 | */ |
679 | if (WARN_ON_ONCE(!atomic_inc_not_zero(&inode->i_count))) { | 680 | if (!atomic_inc_not_zero(&inode->i_count)) { |
680 | rcu_read_unlock(); | 681 | rcu_read_unlock(); |
681 | put_page(page); | 682 | put_page(page); |
682 | 683 | ||