From: Tejun Heo Date: Wed, 2 Apr 2014 20:40:52 +0000 (-0400) Subject: kernfs: protect lazy kernfs_iattrs allocation with mutex X-Git-Tag: omap-for-v3.16/pm-signed~79^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4afddd60a770560d370d6f85c5aef57c16bf7502;p=pandora-kernel.git kernfs: protect lazy kernfs_iattrs allocation with mutex kernfs_iattrs is allocated lazily when operations which require it take place; unfortunately, the lazy allocation and returning weren't properly synchronized and when there are multiple concurrent operations, it might end up returning kernfs_iattrs which hasn't finished initialization yet or different copies to different callers. Fix it by synchronizing with a mutex. This can be smarter with memory barriers but let's go there if it actually turns out to be necessary. Signed-off-by: Tejun Heo Link: http://lkml.kernel.org/g/533ABA32.9080602@oracle.com Reported-by: Sasha Levin Cc: stable@vger.kernel.org # 3.14 Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed