If dispatching write request to merging snapshot device directly to the origin (because the chunk is not remapped or was already merged), we must make exceptions in other snapshots. Signed-off-by: Mikulas Patocka --- drivers/md/dm-snap.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6.27-rc3-devel/drivers/md/dm-snap.c =================================================================== --- linux-2.6.27-rc3-devel.orig/drivers/md/dm-snap.c 2008-08-15 15:49:51.000000000 +0200 +++ linux-2.6.27-rc3-devel/drivers/md/dm-snap.c 2008-08-15 15:50:24.000000000 +0200 @@ -1342,6 +1342,11 @@ static int snapshot_merge_map(struct dm_ bio->bi_bdev = s->origin->bdev; + if (bio_rw(bio) == WRITE) { + up_write(&s->lock); + return do_origin(s->origin, bio); + } + out_unlock: up_write(&s->lock);