rc4 can't take snaphots of 0.9.1_beta7 lvs
Hello everyone,
Looks like the compatibility code in rc4 doesn't properly snapshot beta7 logical volumes (2.4.10 kernel).
To reproduce, I did this:
Install 0.9.1 beta7 tools
pvcreate /dev/sdb2
vgcreate big /dev/sdb2
lvcreate --size 6G -n lv1 big
vgchange -a n
rmmod lvm-mod
Install rc4 tools
vgscan
vchange -a y
mkfs /dev/big/lv1
mount /dev/big/lv1 /data
lvcreate --size 1G -n snap --snapshot /dev/big/lv1 (trigger COW to snapshot)
And I get these messages:
lvm -- _pv_get_number failed for rdev = 0
lvm -- giving up to snapshot /dev/big/lv1 on /dev/big/snap: couldn't prepare kiovec blocks (start probably isn't block aligned).
Now that I can reliably reproduce on stock kernels/tools, I'm trying to trace it further. If anyone has ideas I'd love to hear them.
-chris
Quoted 24 lines · Chris Mason
Hello everyone,
Looks like the compatibility code in rc4 doesn't properly snapshot beta7 logical volumes (2.4.10 kernel).
To reproduce, I did this:
Install 0.9.1 beta7 tools
pvcreate
/dev/sdb2
vgcreate big/dev/sdb2
lvcreate --size 6G -n lv1 big
vgchange -a n
rmmod lvm-modInstall rc4 tools
vgscan
vchange -a y
mkfs/dev/big/lv1
mount/dev/big/lv1/data
lvcreate --size 1G -n snap --snapshot/dev/big/lv1(trigger COW to snapshot)
Quoted 8 lines
And I get these messages:
lvm --
_pv_get_numberfailed for rdev = 0
lvm -- giving up to snapshot/dev/big/lv1on/dev/big/snap: couldn't prepare kiovec blocks (start probably isn't block aligned).Now that I can reliably reproduce on stock kernels/tools, I'm trying to trace it further. If anyone has ideas I'd love to hear them.
Some of the betas misaligned the logical volumes. If the volumes aren't page aligned the snapshot code (which uses kiovecs) cannot work. You have this problem. Fixing it isn't easy; you need to shuffle your extents up or down by the appropriate amount. No one has written a program to do this as of yet. Sorry.
- Joe
Quoted 7 lines · On Tuesday, October 09, 2001 04:58:01 PM +0100 Joe Thornber…
Some of the betas misaligned the logical volumes. If the volumes aren't page aligned the snapshot code (which uses kiovecs) cannot work. You have this problem. Fixing it isn't easy; you need to shuffle your extents up or down by the appropriate amount. No one has written a program to do this as of yet. Sorry.
Well, it worked in beta7 so it certainly should be possible in rc4. I'm sorry if I missed this in the thread(s) where backwards compatibility was discussed, but this does not work as a clean upgrade.
I really do appreciate the compatibility work done so far, but snapshots don't count as a minor feature that can be ignored.
Joe, thanks for the quick response.
-chris
Quoted 5 lines · Chris Mason
Quoted 1 line · On Tuesday, October 09, 2001 04:58:01 PM +0100 Joe Thornber…
Quoted 8 lines
Quoted 6 lines
Some of the betas misaligned the logical volumes. If the volumes aren't page aligned the snapshot code (which uses kiovecs) cannot work. You have this problem. Fixing it isn't easy; you need to shuffle your extents up or down by the appropriate amount. No one has written a program to do this as of yet. Sorry.
Well, it worked in beta7
did it ? It may not have segfaulted, but did you check the data really carefully ? After all it took a while for anyone to realise the problem existed.
- Joe
Quoted 13 lines · Joe Thornber
Quoted 12 lines · Chris Mason
Quoted 7 lines · On Tuesday, October 09, 2001 04:58:01 PM +0100 Joe Thornber…
Some of the betas misaligned the logical volumes. If the volumes aren't page aligned the snapshot code (which uses kiovecs) cannot work. You have this problem. Fixing it isn't easy; you need to shuffle your extents up or down by the appropriate amount. No one has written a program to do this as of yet. Sorry.
Quoted 5 lines
Quoted 1 line
Well, it worked in beta7
did it ? It may not have segfaulted, but did you check the data really carefully ? After all it took a while for anyone to realise the problem existed.
Now I think about it maybe the change was made in order to allow LV's to be used as raw devices. In which case we are being harsh on you. I'll talk to Heinz.
- Joe
Quoted 5 lines · On Tuesday, October 09, 2001 08:30:31 PM +0100 Joe Thornber…
Quoted 1 line
Well, it worked in beta7
did it ? It may not have segfaulted, but did you check the data really carefully ? After all it took a while for anyone to realise the problem existed.
Perhaps I just got really lucky when testing beta7 and didn't end up with any unaligned lvs. Regardless, we should be able to make new snapshots of those volumes now. I'm less worried about supporting existing unaligned snapshots.
So, I'm trying some things, I'll either post patches or beg for help later ;-)
-chris
Quoted 4 lines · On Tuesday, October 09, 2001 08:42:49 PM +0100 Joe Thornber…
Now I think about it maybe the change was made in order to allow LV's to be used as raw devices. In which case we are being harsh on you. I'll talk to Heinz.
BTW, could you also read through lvm_snapshot_COW(), the while(chunksize) loop seems a little wrong. What happens when it takes more than one interation? org_start and snap_start are never incremented, so every interation copies the same physical blcoks.
-chris