]> git.baikalelectronics.ru Git - kernel.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)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 16 Oct 2009 22:18:15 +0000 (23:18 +0100)
commitaf3a4b385d9ded8261cd73fb869da18502117a9a
treeb1de0c32afb6a540624a0e53a25ce522a9935202
parent939c29b7e713bcad2a055d44b290efa7a9246551
dm: dec_pending needs locking to save error value

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.

Cc: stable@kernel.org
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>
drivers/md/dm.c