/* Full snapshots are not usable */
if (!s->valid)
- return -1;
+ return -EIO;
/*
* Write to snapshot - higher level takes care of RW/RO
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);
/*