]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
dm snapshot: avoid having two exceptions for the same chunk
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 3 Apr 2009 17:45:14 +0000 (17:45 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:57 +0000 (10:36 -0700)
commit8068bd7e0480e6295b9e0be85a2eb57f9aba7825
tree5d99ae43c546c603de50e839bdbcd05e6c637017
parente231d89b16b1e137fb098a14a6440da4b4a24786
dm snapshot: avoid having two exceptions for the same chunk

upstream commit: 35bf659b008e83e725dcd30f542e38461dbb867c

We need to check if the exception was completed after dropping the lock.

After regaining the lock, __find_pending_exception checks if the exception
was already placed into &s->pending hash.

But we don't check if the exception was already completed and placed into
&s->complete hash. If the process waiting in alloc_pending_exception was
delayed at this point because of a scheduling latency and the exception
was meanwhile completed, we'd miss that and allocate another pending
exception for already completed chunk.

It would lead to a situation where two records for the same chunk exist
and potential data corruption because multiple snapshot I/Os to the
affected chunk could be redirected to different locations in the
snapshot.

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/md/dm-snap.c