path: root/drivers/md/bcache/super.c
diff options
authorKent Overstreet <kmo@daterainc.com>2013-07-10 18:04:21 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-28 16:30:09 -0700
commitc0d8f455600820eb05208b57c50d4e90a58c4d96 (patch)
treed7090aaa97b7ab40b039be93ed611798e9441e51 /drivers/md/bcache/super.c
parent223828d8a6ef53f7671351fe5d08f18dca714830 (diff)
bcache: Fix a dumb race
commit 6aa8f1a6ca41c49721d2de4e048d3da8d06411f9 upstream. In the far-too-complicated closure code - closures can have destructors, for probably dubious reasons; they get run after the closure is no longer waiting on anything but before dropping the parent ref, intended just for freeing whatever memory the closure is embedded in. Trouble is, when remaining goes to 0 and we've got nothing more to run - we also have to unlock the closure, setting remaining to -1. If there's a destructor, that unlock isn't doing anything - nobody could be trying to lock it if we're about to free it - but if the unlock _is needed... that check for a destructor was racy. Argh. Signed-off-by: Kent Overstreet <kmo@daterainc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/bcache/super.c')
0 files changed, 0 insertions, 0 deletions