1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/misc
Jonathan Brassow d5896f0afd Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors
There is a problem with the way mirrors have been designed to handle
failures that is resulting in stuck LVM processes and hung I/O.  When
mirrors encounter a write failure, they block I/O and notify userspace
to reconfigure the mirror to remove failed devices.  This process is
open to a couple races:
1) Any LVM process other than the one that is meant to deal with the
mirror failure can attempt to read the mirror, fail, and block other
LVM commands (including the repair command) from proceeding due to
holding a lock on the volume group.
2) If there are multiple mirrors that suffer a failure in the same
volume group, a repair can block while attempting to read the LVM
label from one mirror while trying to repair the other.

Mitigation of these races has been attempted by disallowing label reading
of mirrors that are either suspended or are indicated as blocking by
the kernel.  While this has closed the window of opportunity for hitting
the above problems considerably, it hasn't closed it completely.  This is
because it is still possible to start an LVM command, read the status of
the mirror as healthy, and then perform the read for the label at the
moment after a the failure is discovered by the kernel.

I can see two solutions to this problem:
1) Allow users to configure whether mirrors can be candidates for LVM
labels (i.e. whether PVs can be created on mirror LVs).  If the user
chooses to allow label scanning of mirror LVs, it will be at the expense
of a possible hang in I/O or LVM processes.
2) Instrument a way to allow asynchronous label reading - allowing
blocked label reads to be ignored while continuing to process the LVM
command.  This would action would allow LVM commands to continue even
though they would have otherwise blocked trying to read a mirror.  They
can then release their lock and allow a repair command to commence.  In
the event of #2 above, the repair command already in progress can continue
and repair the failed mirror.

This patch brings solution #1.  If solution #2 is developed later on, the
configuration option created in #1 can be negated - allowing mirrors to
be scanned for labels by default once again.
2013-10-22 19:14:33 -05:00
..
.gitignore More .gitignore files for an in-source-tree build. 2012-06-08 16:34:43 +01:00
configure.h.in thin: add thin_repair and thin_dump options 2013-07-31 15:30:47 +02:00
crc_gen.c was renamed 2010-09-27 19:10:46 +00:00
crc.c Fix CRC32 calculation on big endian CPU 2011-02-08 12:41:08 +00:00
crc.h Speed up CRC32 calculations by using a larger lookup table. 2010-09-27 19:09:34 +00:00
intl.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
last-path-component.h cleaner const char* usage for last_path_component() 2008-11-12 09:53:33 +00:00
lib.h more tweaking to get things to compile - dmlib.h for log fns, list.h 2008-11-03 18:59:59 +00:00
lvm-exec.c fix: some issues reported by coverity 2013-08-15 12:23:49 +02:00
lvm-exec.h exec: pipe open 2013-08-06 16:18:43 +02:00
lvm-file.c cleanup: simplify code around flock 2013-07-01 23:06:41 +02:00
lvm-file.h setvbuf: reopen only valid fd 2012-08-27 13:07:07 +02:00
lvm-globals.c Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors 2013-10-22 19:14:33 -05:00
lvm-globals.h Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors 2013-10-22 19:14:33 -05:00
lvm-percent.c lvm-percent.c: Add #include "lib.h" 2013-07-12 16:52:16 -05:00
lvm-percent.h lvm2app: Move percent_of_extents to lvm-percent.[h|c] 2013-07-02 14:24:33 -05:00
lvm-string.c thin: add pool metadata spare lv support 2013-07-18 18:22:43 +02:00
lvm-string.h Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
lvm-version.h.in Add an API version number, LVM_LIBAPI, to the VERSION string. 2009-07-22 20:01:28 +00:00
lvm-wrappers.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
lvm-wrappers.h Remove unsupported udev_get_dev_path libudev call used for checking udev dir. 2012-05-29 08:09:10 +00:00
sharedlib.c config: add profile arg to find_config_tree_str 2013-07-02 15:19:09 +02:00
sharedlib.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
timestamp.c Skip NULL check before dm_free 2011-01-28 10:16:04 +00:00
timestamp.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
util.h Newer gcc doesn't need this trick 2011-04-08 14:11:40 +00:00