diff options
| -rw-r--r-- | drivers/md/dm-snap.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 4c80e82f941c..ee8eb283650d 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
| @@ -1699,11 +1699,9 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, | |||
| 1699 | 1699 | ||
| 1700 | down_write(&s->lock); | 1700 | down_write(&s->lock); |
| 1701 | 1701 | ||
| 1702 | /* Full snapshots are not usable */ | 1702 | /* Full merging snapshots are redirected to the origin */ |
| 1703 | if (!s->valid) { | 1703 | if (!s->valid) |
| 1704 | r = -EIO; | 1704 | goto redirect_to_origin; |
| 1705 | goto out_unlock; | ||
| 1706 | } | ||
| 1707 | 1705 | ||
| 1708 | /* If the block is already remapped - use that */ | 1706 | /* If the block is already remapped - use that */ |
| 1709 | e = dm_lookup_exception(&s->complete, chunk); | 1707 | e = dm_lookup_exception(&s->complete, chunk); |
| @@ -1726,6 +1724,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, | |||
| 1726 | goto out_unlock; | 1724 | goto out_unlock; |
| 1727 | } | 1725 | } |
| 1728 | 1726 | ||
| 1727 | redirect_to_origin: | ||
| 1729 | bio->bi_bdev = s->origin->bdev; | 1728 | bio->bi_bdev = s->origin->bdev; |
| 1730 | 1729 | ||
| 1731 | if (bio_rw(bio) == WRITE) { | 1730 | if (bio_rw(bio) == WRITE) { |
