1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-07 05:58:00 +03:00
David Teigland 31e2c4c1a6 locking: allow using global lock for scanning
When vg metadata consumes a major percentage of the metadata area,
acquire the global lock prior to label_scan.  Many commands
already acquire the global lock prior to label_scan, but
VG-specific commands may not otherwise use the global lock.

This attempts to avoid the rare situation in which the metadata is
large enough to wrap around the metadata area and invalidate the
metadata location information that a single command gathered from
label_scan.  If this wrapping with large sizes occurs, the metadata
locations seen during label scan may be overwritten before the
same command is able to use them for vg_read(), causing vg_read
to see invalid metadata and the command to fail.

A large number of concurrent lvm commands is also a factor that
can lead to this problem due to longer delays between label_scan
and vg_read.

This problem can be avoided if all commands acquire the global lock
prior to label scan, and hold it across all the vg_read() calls.
This ensures that the results from label scan are unchanging during
label scan and remain valid for use in vg_read.
Commands modifying vg metadata take the global lock ex, and those
only reading vg metadata use sh.

This extra use of the global lock is usually unnecessary, so lvm
automatically detects when the extra locking may be needed before
starting to use it.  When vg metadata is a large enough percentage
of the total metadata area, lvm begins doing extra locking.
Currently this is 25% (could be configurable.)

When one command sees this threshold has been reached, it creates
the file /run/lvm/scan_lock_global.  When subsequent commands see
this file exists, then will acquire the global lock prior to their
label_scan.  When metadata goes below the threshold, the temp file
is removed, and commands no longer do the extra locking.
2021-06-14 16:18:33 -05:00
2021-04-23 23:02:58 +02:00
2021-03-30 13:08:14 +02:00
2021-04-23 23:00:55 +02:00
2021-06-11 13:27:18 -05:00
2015-07-04 14:36:57 +02:00
2021-03-02 22:54:40 +01:00
2021-04-23 23:00:55 +02:00
2021-02-23 16:43:32 -06:00
2020-11-25 16:57:54 -06:00
2021-03-19 23:21:18 +01:00
2020-12-11 12:16:16 +01:00
2016-01-21 12:11:37 +01:00
2018-07-27 17:09:46 +02:00
2008-11-04 17:49:22 +00:00
2020-08-12 12:05:36 +02:00
2017-12-14 16:45:47 +01:00
2021-05-07 23:09:15 +02:00
2021-05-07 23:09:15 +02:00
2021-05-07 23:09:15 +02:00

This tree contains the LVM2 and device-mapper tools and libraries.

This is development branch, for stable 2.02 release see stable-2.02 branch.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sourceware.org/pub/lvm2/
  https://github.com/lvmteam/lvm2/releases

The source code is stored in git:
  https://sourceware.org/git/?p=lvm2.git
  git clone git://sourceware.org/git/lvm2.git
mirrored to:
  https://github.com/lvmteam/lvm2
  git clone https://github.com/lvmteam/lvm2.git
  git clone git@github.com:lvmteam/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/lvm-devel

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

Website:
  https://sourceware.org/lvm2/

Report upstream bugs at:
  https://bugzilla.redhat.com/enter_bug.cgi?product=LVM%20and%20device-mapper
or open issues at:
  https://github.com/lvmteam/lvm2/issues

The source code repository used until 7th June 2012 is accessible using CVS:

  cvs -d :pserver:cvs@sourceware.org:/cvs/lvm2 login cvs
  cvs -d :pserver:cvs@sourceware.org:/cvs/lvm2 checkout LVM2

The password is cvs.
Description
LVM2 mirror repository
https://sourceware.org/lvm2/
Readme 55 MiB
Languages
C 75.6%
Shell 18.7%
Python 2.9%
M4 0.9%
Makefile 0.8%
Other 1%