From d2af4f6dc8cb72e183ddf08cb8f13a32e54b74dd Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Tue, 12 Jul 2005 15:53:05 -0700 Subject: [PATCH] --- yaml --- r: 4751 b: refs/heads/master c: d5e404c10a98fc2979643476851e9cbdb1944812 h: refs/heads/master i: 4749: 57401ebdca51fa9c0f9dc6d024839bb614a82c5b 4747: 2b8a4d65f5fb303768fe232763f94befc73c33b0 4743: 21650cd41e66895735bff30a75e40da56ea5198a 4735: 0dab57f216cc970b98bdf74adf1548898ce003e0 v: v3 --- [refs] | 2 +- trunk/drivers/md/dm-snap.c | 4 ++++ trunk/drivers/md/dm-table.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index fdecfde3c06e..1dfed8f5094a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 93c534aefb906824d71ea779ed0c7f1573843f4e +refs/heads/master: d5e404c10a98fc2979643476851e9cbdb1944812 diff --git a/trunk/drivers/md/dm-snap.c b/trunk/drivers/md/dm-snap.c index 594d1f6b4789..ab54f99b7c3b 100644 --- a/trunk/drivers/md/dm-snap.c +++ b/trunk/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); /* diff --git a/trunk/drivers/md/dm-table.c b/trunk/drivers/md/dm-table.c index 18e9b9953fcd..a5a4c0ed8a14 100644 --- a/trunk/drivers/md/dm-table.c +++ b/trunk/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);