]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
dm: dec_pending needs locking to save error value
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>
Fri, 16 Oct 2009 22:18:15 +0000 (23:18 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:22:06 +0000 (16:22 -0800)
commitc5d0c81248f5b0d14f464f4170f76fb756df5ac0
tree79a5701be1628d0ad2b082296e4ac4b50d649865
parent17f34f975f03e1cdad57fc04c590a750e2558d42
dm: dec_pending needs locking to save error value

commit f88fb981183e71daf40bbd84bc8251bbf7b59e19 upstream.

Multiple instances of dec_pending() can run concurrently so a lock is
needed when it saves the first error code.

I have never experienced actual problem without locking and just found
this during code inspection while implementing the barrier support
patch for request-based dm.

This patch adds the locking.
I've done compile, boot and basic I/O testings.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm.c