[lkml]   [2018]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()
On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote:
> If two threads run nested_table_alloc() at the same time
> they could both allocate a new table.
> Best case is that one of them will never be freed, leaking memory.
> Worst case is hat entry get stored there before it leaks,
> and the are lost from the table.
> So use cmpxchg to detect the race and free the unused table.
> Fixes: da20420f83ea ("rhashtable: Add nested tables")
> Cc: # 4.11+
> Signed-off-by: NeilBrown <>

What about the spinlock that's meant to be held around this

Email: Herbert Xu <>
Home Page:
PGP Key:

 \ /
  Last update: 2018-05-05 11:30    [W:0.127 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site