summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2005-07-12 15:53:05 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-12 16:19:11 -0700
commitd5e404c10a98fc2979643476851e9cbdb1944812 (patch)
tree1d7d846b43a6a8a022e5cf4fd5453b27abf0de94 /drivers/md/dm-snap.c
parent93c534aefb906824d71ea779ed0c7f1573843f4e (diff)
downloadop-kernel-dev-d5e404c10a98fc2979643476851e9cbdb1944812.zip
op-kernel-dev-d5e404c10a98fc2979643476851e9cbdb1944812.tar.gz
[PATCH] device-mapper snapshots: Handle origin extension
Handle writes to a snapshot-origin device that has been extended since the snapshot was taken. 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>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 594d1f6..ab54f99 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -931,6 +931,10 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)
if (!snap->valid)
continue;
+ /* Nothing to do if writing beyond end of snapshot */
+ if (bio->bi_sector >= dm_table_get_size(snap->table))
+ continue;
+
down_write(&snap->lock);
/*
OpenPOWER on IntegriCloud