1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
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
..
activate lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00
cache covscan: free wwid strings in lvmcache 2022-09-21 12:15:13 -05:00
cache_segtype gcc: remove invalid attribute 2021-09-13 12:34:41 +02:00
commands make: move cmds.h 2022-09-27 09:06:06 -05:00
config device id: add new types using values from vpd_pg83 2022-10-10 11:47:29 -05:00
datastruct cleanup: eliminate unused assign 2021-03-11 00:18:01 +01:00
device lvmdevices: use deviceidtype option strictly 2022-10-10 11:47:29 -05:00
display gcc-fanalyzer: helping understand answer is not null 2021-09-21 21:03:47 +02:00
error device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
filters filters: remove unused internal filter 2022-04-06 12:51:34 -05:00
format_text _vg_read_raw_area: fix segfault caused by using null pointer 2022-08-15 09:39:02 -05:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
integrity cleanup: no backtraces needed after log_error 2021-03-10 01:11:52 +01:00
label cov: remove unused headers 2022-07-11 01:18:24 +02:00
locking lvresize: restructure code 2022-09-09 16:18:55 -05:00
log shell: add pre-cmd log report object type and enable lastlog for it 2022-08-22 14:06:34 +02:00
lvmpolld device usage based on devices file 2021-02-23 16:43:32 -06:00
metadata toollib: do not process just created historical LV 2022-10-12 15:14:59 +02:00
mirror lv_info: missing check for info.exists 2021-03-14 16:34:38 +01:00
misc utils: define macro for ffs 2021-09-27 18:56:14 +02:00
mm mm: use mallinfo2 when available 2022-08-30 13:56:16 +02:00
notify build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
properties build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
raid cleanup: reduce code dupliction 2021-03-19 23:21:18 +01:00
report report: fix lv_active column type from STR to BIN 2022-09-06 15:49:27 +02:00
snapshot typo: fixes 2021-02-08 23:53:41 +01:00
striped device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
thin thin: rename internal function 2022-08-30 13:54:19 +02:00
unknown device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
uuid asan: fix some reports from libasan 2022-02-07 20:02:11 +01:00
vdo vdo: support v4 kernel target line 2022-07-11 01:18:24 +02:00
writecache typo: fixes 2021-02-08 23:53:41 +01:00
zero device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
Makefile.in lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00