]> err.no Git - linux-2.6/blobdiff - drivers/md/dm-snap.c
[PATCH] blk: Use blk_queue_xxx functions to set parameters
[linux-2.6] / drivers / md / dm-snap.c
index 7e691ab9a748a665d8417a7865de59afd36a05bb..ab54f99b7c3b27cfd40a023bae56f9e0ed0b0f18 100644 (file)
@@ -777,7 +777,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
 
        /* Full snapshots are not usable */
        if (!s->valid)
-               return -1;
+               return -EIO;
 
        /*
         * 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)
                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);
 
                /*