tree 1d7d846b43a6a8a022e5cf4fd5453b27abf0de94
parent 93c534aefb906824d71ea779ed0c7f1573843f4e
author Alasdair G Kergon <[EMAIL PROTECTED]> Wed, 13 Jul 2005 05:53:05 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Wed, 13 Jul 2005 06:19:11 -0700
[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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
drivers/md/dm-snap.c | 4 ++++
drivers/md/dm-table.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -931,6 +931,10 @@ static int __origin_write(struct list_he
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);
/*
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -943,6 +943,7 @@ EXPORT_SYMBOL(dm_vcalloc);
EXPORT_SYMBOL(dm_get_device);
EXPORT_SYMBOL(dm_put_device);
EXPORT_SYMBOL(dm_table_event);
+EXPORT_SYMBOL(dm_table_get_size);
EXPORT_SYMBOL(dm_table_get_mode);
EXPORT_SYMBOL(dm_table_put);
EXPORT_SYMBOL(dm_table_get);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html