1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/metadata
Peter Rajnoha 908555459f toollib: do not process just created historical LV
When executing process_each_lv_in_vg, we process live LVs first and
after that, we process any historical LVs. In case we have just removed
an LV, which also means we have just made it "historical" and so it
appears as fresh item in vg->historical_lvs list, we have to skip it
when we get to processing historical LVs inside the same process_each_lv_in_vg
call.

The simplest approach here, without introducing another LV list, is to
simply mark such historical LVs as "fresh" directly in struct
historical_logical_volume when we have just removed the original LV
and created the historical LV for it. Then, we just need to check the
flag when processing historical LVs and skip it if it is "fresh".

When we read historical LVs out of metadata, they are marked as
"not fresh" and so they can be processed as usual.

This was mainly an issue in conjuction with -S|--select use:

	#  lvmconfig --type diff
	metadata {
		record_lvs_history=1
	}

(In this example, a thin pool with lvol1 thin LV and lvol2 and lvol3 snapshots.)

	#  lvs -H vg -o name,pool_lv,full_ancestors,full_descendants
	  LV    Pool FAncestors  FDescendants
	  lvol1 pool             lvol2,lvol3
	  lvol2 pool lvol1       lvol3
	  lvol3 pool lvol2,lvol1
	  pool

	#  lvremove -S 'name=lvol2'
	  Logical volume "lvol2" successfully removed.
	  Historical logical volume "lvol2" successfully removed.

...here, the historical LV lvol2 should not have been removed because
we have just removed its original non-historical lvol2 and the fresh
historical lvol2 must not be included in the same processing spree.
2022-10-12 15:14:59 +02:00
..
cache_manip.c cov: initialize attr 2021-09-13 12:34:41 +02:00
integrity_manip.c fix fs block size detection 2022-09-09 15:50:00 -05:00
lv_alloc.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lv_manip.c lvreduce: require active LV when no fs option is used 2022-10-11 12:48:31 -05:00
lv.c cleanup: use already known lv size 2021-09-27 18:56:14 +02:00
lv.h toollib: do not process just created historical LV 2022-10-12 15:14:59 +02:00
merge.c vdo: use single validator 2022-07-11 01:18:24 +02:00
metadata-exported.h lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00
metadata.c lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00
metadata.h lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00
mirror.c devices: fix dev_name assumptions 2022-02-24 17:22:04 -06:00
pool_manip.c toollib: do not process just created historical LV 2022-10-12 15:14:59 +02:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_list.c devices: fix dev_name assumptions 2022-02-24 17:22:04 -06:00
pv_manip.c cov: remove unneeded includes 2021-07-28 00:49:28 +02:00
pv_map.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
pv_map.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
pv.c cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
pv.h cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
raid_manip.c cleanup: use dm_list_empty 2021-10-06 15:43:31 +02:00
segtype.c segtype: add linear 2018-06-05 16:23:18 +02:00
segtype.h vdo: support v4 kernel target line 2022-07-11 01:18:24 +02:00
snapshot_manip.c gcc-fanalyzer: add extra check for origin_from_cow 2021-09-20 13:58:57 +02:00
takeover_matrix.h lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
thin_manip.c thin: rename internal function 2022-08-30 13:54:19 +02:00
vdo_manip.c devices: drop double // from sysfs path 2022-08-19 14:56:57 +02:00
vg.c devices: fix dev_name assumptions 2022-02-24 17:22:04 -06:00
vg.h metadata: remember parsing size of VG metadata 2021-09-27 18:49:41 +02:00
writecache_manip.c writecache: use cleaner message instead of table reload 2021-01-28 15:14:25 -06:00