]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Fix race related problem when adding items to and svcrpc auth cache.
authorNeil Brown <neilb@suse.de>
Thu, 3 Aug 2006 00:20:12 +0000 (10:20 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Aug 2006 03:52:15 +0000 (20:52 -0700)
commitd267cf77ff0425cd0f3292aa312588baaf304bb5
tree56d4964e738e7ac233971e2a7949c4496b5ec1bc
parentc21e358f1136635d6f2bbc6552efef8b01499254
Fix race related problem when adding items to and svcrpc auth cache.

Fix race related problem when adding items to and svcrpc auth cache.

If we don't find the item we are lookng for, we allocate a new one,
and then grab the lock again and search to see if it has been added
while we did the alloc.
If it had been added we need to 'cache_put' the newly created item
that we are never going to use.  But as it hasn't been initialised
properly, putting it can cause an oops.

So move the ->init call earlier to that it will always be fully
initilised if we have to put it.

Thanks to Philipp Matthias Hahn <pmhahn@svs.Informatik.Uni-Oldenburg.de>
for reporting the problem.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/cache.c