Skip to contentSkip to conversation

device-mapper snapshots: Handle origin extension

PATCH New Alasdair G Kergon 1 participant 1 message Jul 8, 2005 Device mapper

lore
Share & tools
lore

Alasdair G Kergon

author maintainer
#0 lore raw

PATCH 1/1 device-mapper snapshots: Handle origin extension

Handle writes to a snapshot-origin device that has been extended since the snapshot was taken.

drivers/md/dm-snap.c +4 -0
@@ -931,6 +931,10 @@
 		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);
 
 		/*
drivers/md/dm-table.c +1 -0
@@ -943,6 +943,7 @@
 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);