[PATCH] device-mapper snapshots: Handle origin extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-Off-By: Alasdair G Kergon <[email protected]>

--- diff/drivers/md/dm-snap.c	2005-07-08 19:01:41.000000000 +0100
+++ source/drivers/md/dm-snap.c	2005-07-08 19:41:00.000000000 +0100
@@ -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);
 
 		/*
--- diff/drivers/md/dm-table.c	2005-06-17 20:48:29.000000000 +0100
+++ source/drivers/md/dm-table.c	2005-07-08 19:41:00.000000000 +0100
@@ -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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux