merging snapshots and lvs bug
Currently the first field of the attribute bits are set to 's' for a snapshot and 'S' for a merging snap. Unfortunatly 'S' was used for an invalid snapshot and lvs still uses it both ways.
LVM version: 2.02.86(2) (2011-07-08)
Library version: 1.02.65 (2011-07-08)
Driver version: 4.20.0
Quoted 3 lines · ben
Currently the first field of the attribute bits are set to 's' for a snapshot and 'S' for a merging snap. Unfortunatly 'S' was used for an invalid snapshot and lvs still uses it both ways.
Invalid snapshot is meant to be shown by I (for invalid) in the 5th position.
The lv_attr bits are:
1 Volume type: (m)irrored, (M)irrored without initial sync,
(o)rigin, (O)rigin with merging snapshot, (s)napshot, merging
(S)napshot, (p)vmove, (v)irtual, mirror (i)mage, mirror
(I)mage out-of-sync, under (c)onversion
5 State: (a)ctive, (s)uspended, (I)nvalid snapshot, invalid
(S)uspended snapshot, mapped (d)evice present without tables, mapped device present with (i)nactive table
If some particular case is giving the wrong output, please show us exactly which case that is, and how the output looks, together with 'dmsetup info -c', 'dmsetup table' and 'dmsetup status'.
Alasdair
Quoted 19 lines · Alasdair G Kergon
Quoted 3 lines · ben
Currently the first field of the attribute bits are set to 's' for a snapshot and 'S' for a merging snap. Unfortunatly 'S' was used for an invalid snapshot and lvs still uses it both ways.
Invalid snapshot is meant to be shown by I (for invalid) in the 5th position.
The
lv_attrbits are:1 Volume type: (m)irrored, (M)irrored without initial
sync, (o)rigin, (O)rigin with merging snapshot, (s)napshot, merging
(S)napshot, (p)vmove, (v)irtual, mirror (i)mage, mirror (I)mage
out-of-sync, under (c)onversion5 State: (a)ctive, (s)uspended, (I)nvalid snapshot,
invalid (S)uspended snapshot, mapped (d)evice present without tables, mapped device present with (i)nactive table
Quoted 5 lines
If some particular case is giving the wrong output, please show us exactly which case that is, and how the output looks, together with 'dmsetup info -c', 'dmsetup table' and 'dmsetup status'.
Alasdair
It isn't a special case. Invalid snaps use capital 'S' in the first column and so do merging snaps. The invalid snap 'S' dates back to old versions of LVM. Here we have three snaps, the first is invalid, the second is merging and the last is normal:
LV VG Attr LSize Origin Snap% Move Log Copy% Convert lv1 vg01 owi-a- 1023.00m lv2 vg01 Owi-a- 2.00g lv3 vg01 owi-a- 1023.00m snap1 vg01 Swi-I- 102.00m lv1 100.00
[snap2] vg01 Swi-a- 1023.00m lv2 30.25
snap3 vg01 swi-a- 102.00m lv3 0.00
vg01-snap3-cow 254 11 L--w 1 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72faEpbkeDdAe81saUi0RzfzdLRlKU3uDkw9-cow
vg01-lv3 254 8 L--w 0 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72faDeYH4cymsf09Bc3eZSzBuaA1BQnsdX2G
vg01-lv2 254 4 L--w 0 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72fa0N2vOYUtmgPDeaNpGw2VlFDao15M6Ilw
vg01-lv1-real 254 2 L--w 2 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72facep9w6L1Pdy03yE23PuByJVKAPXZqsWf-real
vg01-lv1 254 0 L--w 0 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72facep9w6L1Pdy03yE23PuByJVKAPXZqsWf
vg01-snap3 254 9 L--w 0 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72faEpbkeDdAe81saUi0RzfzdLRlKU3uDkw9
vg01-lv2-real 254 6 L--w 2 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72fa0N2vOYUtmgPDeaNpGw2VlFDao15M6Ilw-real
vg01-snap2 254 5 L--w 0 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72fal7p85XD8336q9jyIFDXa6Xb0JCl3ZPNX
vg01-lv3-real 254 10 L--w 2 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72faDeYH4cymsf09Bc3eZSzBuaA1BQnsdX2G-real
vg01-snap1 254 1 L--w 0 1 1 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72faUWfv2h31eXQkcm0f712lGTcxPKwqgzBr
vg01-snap1-cow 254 3 L--w 1 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72faUWfv2h31eXQkcm0f712lGTcxPKwqgzBr-cow
vg01-snap2-cow 254 7 L--w 1 1 0 LVM-
UiEDiN8ISFoHCVpdhKbIJ3y8tmLY72fal7p85XD8336q9jyIFDXa6Xb0JCl3ZPNX-cow
vg01-snap3-cow: 0 208896 linear
vg01-lv3: 0 2095104 snapshot-origin
vg01-lv2: 0 4192256 snapshot-origin
vg01-lv1-real: 0 2095104 linear
vg01-lv1: 0 2095104 snapshot-origin
vg01-snap3: 0 2095104 snapshot 16/208896 16
vg01-lv2-real: 0 4192256 linear
vg01-snap2: 0 4192256 snapshot 633768/2095104 2480
vg01-lv3-real: 0 2095104 linear
vg01-snap1: 0 2095104 snapshot Invalid
vg01-snap1-cow: 0 208896 linear
vg01-snap2-cow: 0 2095104 linear
Quoted 4 lines · ben
It isn't a special case. Invalid snaps use capital 'S' in the first column and so do merging snaps. The invalid snap 'S' dates back to old versions of LVM. Here we have three snaps, the first is invalid, the second is merging and the last is normal:
Oh, yes, I see. Curiously the man page used to mention that and it got replaced with S for merging.
So do you think we should remove that capitalisation, as per the man page I quoted?
Alasdair
Quoted 6 lines · Alasdair G Kergon
Quoted 4 lines · ben
It isn't a special case. Invalid snaps use capital 'S' in the first column and so do merging snaps. The invalid snap 'S' dates back to old versions of LVM. Here we have three snaps, the first is invalid, the second is merging and the
Quoted 8 lines
Quoted 1 line
last is normal:
Oh, yes, I see. Curiously the man page used to mention that and it got replaced with S for merging.
So do you think we should remove that capitalisation, as per the man page I quoted?
Alasdair
The old meaning seems like unneeded duplication since it is flagged as invalid in another column. Also, I actually found it through liblvm2app, so it needs to be changed there as well.
Thank you.
Quoted 11 lines · Alasdair G Kergon
Quoted 4 lines · ben
It isn't a special case. Invalid snaps use capital 'S' in the first column and so do merging snaps. The invalid snap 'S' dates back to old versions of LVM. Here we have three snaps, the first is invalid, the second is merging and the last is normal:
Oh, yes, I see. Curiously the man page used to mention that and it got replaced with S for merging.
So do you think we should remove that capitalisation, as per the man page I quoted?
Yes, I think we should remove the capitalization.
It is the repstr[0] = toupper(repstr[0]); in the lib/metadata/lv.c:lv_attr_dup() block I just quoted in a different mail (re: --merge bug).