]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] device-mapper snapshot: fix invalidation
authorAlasdair G Kergon <agk@redhat.com>
Mon, 27 Mar 2006 09:17:45 +0000 (01:17 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 27 Mar 2006 16:44:58 +0000 (08:44 -0800)
commitb81cdd79fd9ab8cf7e14977499f06753a206ae85
tree5458257a6a089396ac6ed5883a916af542ca8477
parentf49c3032b337dec46cf04c3afb312ab749d7e0b5
[PATCH] device-mapper snapshot: fix invalidation

When a snapshot becomes invalid, s->valid is set to 0.  In this state, a
snapshot can no longer be accessed.

When s->lock is acquired, before doing anything else, s->valid must be checked
to ensure the snapshot remains valid.

This patch eliminates some races (that may cause panics) by adding some
missing checks.  At the same time, some unnecessary levels of indentation are
removed and snapshot invalidation is moved into a single function that always
generates a device-mapper event.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm-snap.c