]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/dm-snap.c
Merge commit 'gcl/merge' into merge
[karo-tx-linux.git] / drivers / md / dm-snap.c
index 4c80e82f941c92e59442e15f1c2a6c22032b96a2..ee8eb283650d6ccbe3a5a6e3d6a39ba347d6c35c 100644 (file)
@@ -1699,11 +1699,9 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio,
 
        down_write(&s->lock);
 
-       /* Full snapshots are not usable */
-       if (!s->valid) {
-               r = -EIO;
-               goto out_unlock;
-       }
+       /* Full merging snapshots are redirected to the origin */
+       if (!s->valid)
+               goto redirect_to_origin;
 
        /* If the block is already remapped - use that */
        e = dm_lookup_exception(&s->complete, chunk);
@@ -1726,6 +1724,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio,
                goto out_unlock;
        }
 
+redirect_to_origin:
        bio->bi_bdev = s->origin->bdev;
 
        if (bio_rw(bio) == WRITE) {