1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib/metadata
Peter Rajnoha 039bdad732 activation: flag temporary LVs internally
Add LV_TEMPORARY flag for LVs with limited existence during command
execution. Such LVs are temporary in way that they need to be activated,
some action done and then removed immediately. Such LVs are just like
any normal LV - the only difference is that they are removed during
LVM command execution. This is also the case for LVs representing
future pool metadata spare LVs which we need to initialize by using
the usual LV before they are declared as pool metadata spare.

We can optimize some other parts like udev to do a better job if
it knows that the LV is temporary and any processing on it is just
useless.

This flag is orthogonal to LV_NOSCAN flag introduced recently
as LV_NOSCAN flag is primarily used to mark an LV for the scanning
to be avoided before the zeroing of the device happens. The LV_TEMPORARY
flag makes a difference between a full-fledged LV visible in the system
and the LV just used as a temporary overlay for some action that needs to
be done on underlying PVs.

For example: lvcreate --thinpool POOL --zero n -L 1G vg

- first, the usual LV is created to do a clean up for pool metadata
  spare. The LV is activated, zeroed, deactivated.

- between "activated" and "zeroed" stage, the LV_NOSCAN flag is used
  to avoid any scanning in udev

- betwen "zeroed" and "deactivated" stage, we need to avoid the WATCH
  udev rule, but since the LV is just a usual LV, we can't make a
  difference. The LV_TEMPORARY internal LV flag helps here. If we
  create the LV with this flag, the DM_UDEV_DISABLE_DISK_RULES
  and DM_UDEV_DISABLE_OTHER_RULES flag are set (just like as it is
  with "invisible" and non-top-level LVs) - udev is directed to
  skip WATCH rule use.

- if the LV_TEMPORARY flag was not used, there would normally be
  a WATCH event generated once the LV is closed after "zeroed"
  stage. This will make problems with immediated deactivation that
  follows.
2013-10-23 14:09:37 +02:00
..
lv_alloc.h discards: don't discard reconfigured extents 2012-06-27 22:12:01 +01:00
lv_manip.c activation: flag temporary LVs internally 2013-10-23 14:09:37 +02:00
lv.c RAID: Report RAID images split with tracking as out-of-sync ("I"). 2013-10-14 10:48:44 -05:00
lv.h report: add vg_profile and lv_profile to report the profile attached to VG/LV 2013-07-02 15:22:12 +02:00
merge.c thin: validation catch multiseg thin pool/volumes 2013-09-07 03:32:07 +02:00
metadata-exported.h activation: flag temporary LVs internally 2013-10-23 14:09:37 +02:00
metadata.c metadata: Fix metadata repair paths when lvmetad is used. 2013-10-09 14:44:01 +02:00
metadata.h metadata: Fix metadata repair paths when lvmetad is used. 2013-10-09 14:44:01 +02:00
mirror.c Revert a previous change 2013-07-24 14:18:07 -05:00
pv_alloc.h discards: split discard from release_pv_segment 2012-06-27 22:11:54 +01:00
pv_manip.c cleanup: use dm_list_empty 2013-07-18 18:22:42 +02:00
pv_map.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
pv_map.h Track unreserved space for all alloc policies and then permit NORMAL to place 2012-02-01 02:10:45 +00:00
pv.c refactor: rename embedding area -> bootloader area 2013-05-28 12:37:22 +02:00
pv.h refactor: rename embedding area -> bootloader area 2013-05-28 12:37:22 +02:00
raid_manip.c RAID: Make RAID single-machine-exclusive capable in a cluster 2013-09-10 16:33:22 -05:00
replicator_manip.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
segtype.c clean: remove unneeded assign 2013-06-17 09:34:56 +02:00
segtype.h cleanup: indent line 2013-04-02 15:17:05 +02:00
snapshot_manip.c snapshot: deactivate virtual snapshot first 2013-10-14 00:25:15 +02:00
thin_manip.c activation: flag temporary LVs internally 2013-10-23 14:09:37 +02:00
vg.c RAID: Make RAID single-machine-exclusive capable in a cluster 2013-09-10 16:33:22 -05:00
vg.h thin: add pool metadata spare lv support 2013-07-18 18:22:43 +02:00