diff options
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 7e691ab9a748..ab54f99b7c3b 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -777,7 +777,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio, | |||
777 | 777 | ||
778 | /* Full snapshots are not usable */ | 778 | /* Full snapshots are not usable */ |
779 | if (!s->valid) | 779 | if (!s->valid) |
780 | return -1; | 780 | return -EIO; |
781 | 781 | ||
782 | /* | 782 | /* |
783 | * Write to snapshot - higher level takes care of RW/RO | 783 | * Write to snapshot - higher level takes care of RW/RO |
@@ -931,6 +931,10 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio) | |||
931 | if (!snap->valid) | 931 | if (!snap->valid) |
932 | continue; | 932 | continue; |
933 | 933 | ||
934 | /* Nothing to do if writing beyond end of snapshot */ | ||
935 | if (bio->bi_sector >= dm_table_get_size(snap->table)) | ||
936 | continue; | ||
937 | |||
934 | down_write(&snap->lock); | 938 | down_write(&snap->lock); |
935 | 939 | ||
936 | /* | 940 | /* |