[dm-devel] shared snapshots release 17
Mikulas Patocka
mpatocka at redhat.com
Sat Mar 27 00:36:41 UTC 2010
Hi
Thanks for finding it. I used a smaller fix that does the same thing, but
doesn't introduce a new function.
Mikulas
> multisnap_origin_iterate_devices() is failing for me with:
> kernel: device-mapper: table: 253:0: dm-2 too small for target: start=0, len=8388608, dev_size=2097152
>
> After failure to reload the origin, the remaining tables are:
> test-testlv1: 0 8388608 linear 254:16 384
> test-testlv1-cow: 0 2097152 linear 254:16 8388992
> test-testlv1-real: 0 8388608 linear 254:16 384
>
>
> The following patch fixes it for me, but it needs further cleanup
> (duplicates method from the old snapshot code).
>
> diff --git a/drivers/md/dm-multisnap.c b/drivers/md/dm-multisnap.c
> index 5ba1af8..0644e19 100644
> --- a/drivers/md/dm-multisnap.c
> +++ b/drivers/md/dm-multisnap.c
> @@ -113,6 +113,15 @@ EXPORT_SYMBOL(dm_multisnap_drop_on_error);
> static DEFINE_MUTEX(all_multisnapshots_lock);
> static LIST_HEAD(all_multisnapshots);
>
> +/*
> + * Return the number of sectors in the device.
> + * FIXME: duplicates dm-exception-store.h:get_dev_size
> + */
> +static inline sector_t get_dev_size(struct block_device *bdev)
> +{
> + return i_size_read(bdev->bd_inode) >> SECTOR_SHIFT;
> +}
> +
> static chunk_t sector_to_chunk(struct dm_multisnap *s, sector_t sector)
> {
> return sector >> (s->chunk_shift - SECTOR_SHIFT);
> @@ -1476,7 +1485,8 @@ static int multisnap_iterate_devices(struct dm_target *ti, struct dm_multisnap *
> r = fn(ti, s->origin, 0, s->origin_sectors, data);
>
> if (!r)
> - r = fn(ti, s->snapshot, 0, s->origin_sectors, data);
> + r = fn(ti, s->snapshot, 0,
> + get_dev_size(dm_multisnap_snapshot_bdev(s)), data);
>
> return r;
> }
>
More information about the dm-devel
mailing list