[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>
This commit is contained in:
Alasdair G Kergon 2005-07-12 15:53:05 -07:00 committed by Linus Torvalds
parent 93c534aefb
commit d5e404c10a
2 changed files with 5 additions and 0 deletions

View file

@ -931,6 +931,10 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)
if (!snap->valid) if (!snap->valid)
continue; 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); down_write(&snap->lock);
/* /*

View file

@ -943,6 +943,7 @@ EXPORT_SYMBOL(dm_vcalloc);
EXPORT_SYMBOL(dm_get_device); EXPORT_SYMBOL(dm_get_device);
EXPORT_SYMBOL(dm_put_device); EXPORT_SYMBOL(dm_put_device);
EXPORT_SYMBOL(dm_table_event); EXPORT_SYMBOL(dm_table_event);
EXPORT_SYMBOL(dm_table_get_size);
EXPORT_SYMBOL(dm_table_get_mode); EXPORT_SYMBOL(dm_table_get_mode);
EXPORT_SYMBOL(dm_table_put); EXPORT_SYMBOL(dm_table_put);
EXPORT_SYMBOL(dm_table_get); EXPORT_SYMBOL(dm_table_get);