1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00
lvm2/lib/activate
Peter Rajnoha 48df36b8c5 activation: check for open count with a timeout before removal/deactivation of an LV
This patch reinstates the lv_info call to check for open count of
the LV we're removing/deactivating - this was changed with commit 125712b
some time ago and we relied on the ioctl retry logic deeper in the libdm
while calling the exact 'remove' ioctl.

However, there are still some situations in which it's still required to
check for open count before we do any 'remove' actions - this mainly
applies to LVs which consist of several sub LVs, like it is for
virtual snapshot devices.

The commit 1146691 fixed the issue with ordering of actions during
virtual snapshot removal while the snapshot is still open. But
the check for the open status of the snapshot is still prone to
marking the snapshot as in use with an immediate exit even though
this could be a temporary asynchronous open only, most notably
because of udev and its WATCH udev rule with accompanying scans
for the event which is asynchronous. The situation where this crops
up most often is when we're closing the LV that was open for read-write
and then calling lvremove immediately.

This patch reinstates the original lv_info call for the open status
of the LV in the lv_check_not_in_use fn that gets called before
we do any LV removal/deactivation. In addition to original logic,
this patch adds its own retry loop with a delay (25x0.2 seconds)
besides the existing ioctl retry loop.
2013-10-15 12:44:42 +02:00
..
activate.c activation: check for open count with a timeout before removal/deactivation of an LV 2013-10-15 12:44:42 +02:00
activate.h activation: add support for flagging an LV to skip udev scanning during activation 2013-10-08 13:43:14 +02:00
dev_manager.c activation: add support for flagging an LV to skip udev scanning during activation 2013-10-08 13:43:14 +02:00
dev_manager.h RAID: Add scrubbing support for RAID LVs 2013-04-11 15:33:59 -05:00
fs.c clean-up: Typo 's/should had/should have/' 2013-03-06 08:42:03 -06:00
fs.h Fix lv_info open_count test 2011-10-14 13:23:47 +00:00
targets.h Use UUIDs instead of names while processing event handlers. 2010-04-14 13:01:38 +00:00