* Snapshot read consistency?
@ 2005-04-27 19:55 Ondrej Palkovsky
0 siblings, 0 replies; only message in thread
From: Ondrej Palkovsky @ 2005-04-27 19:55 UTC (permalink / raw)
To: dm-devel
I am trying to modify the snapshot code to slightly different layout of
the exception store (to mimic behaviour of some commercial systems), and
I came across the code to read data from snapshot. It seems to me that
if the code is preempted after the up_read(&s->lock), the pending
exception could be completed (or even new exception could be created and
written!), the new block could be written to the origin and then the
snapshot would read the new-incorrect data from origin. Highly
improbable, but possible? Am I correct or is there some other locking
mechanism that I have missed?
Ondrej
- snapshot_map(), dm-snap.c
if (bio_rw(bio) == WRITE) {
.......
} else {
/*
* FIXME: this read path scares me because we
* always use the origin when we have a pending
* exception. However I can't think of a
* situation where this is wrong - ejt.
*/
/* Do reads */
down_read(&s->lock);
/* See if it it has been remapped */
e = lookup_exception(&s->complete, chunk);
if (e)
remap_exception(s, e, bio);
else
bio->bi_bdev = s->origin->bdev;
up_read(&s->lock);
}
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-27 19:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-27 19:55 Snapshot read consistency? Ondrej Palkovsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.