1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
David Teigland 6ab2a22fcf lvremove: fix failed remove of all LVs in shared VG
commit a125a3bb50 "lv_remove: reduce commits for removed LVs"
changed "lvremove <vgname>" from removing one LV at a time,
to removing all LVs in one vg write/commit.  It also changed
the behavior if some of the LVs could not be removed, from
removing those LVs that could be removed, to removing nothing
if any LV could not be removed.  This caused a regression in
shared VGs using sanlock, in which the on-disk lease was
removed for any LV that could be removed, even if the command
decided to remove nothing.  This would leave LVs without a
valid ondisk lease, and "lock failed: error -221" would be
returned for any command attempting to lock the LV.

Fix this by not freeing the on-disk leases until after the
command has decided to go ahead and remove everything, and
has written the VG metadata.

Before the fix:

node1: lvchange -ay vg/lv1
node2: lvchange -ay vg/lv2

node1: lvs
  lv1  test -wi-a----- 4.00m
  lv2  test -wi------- 4.00m
node2: lvs
  lv1  test -wi------- 4.00m
  lv2  test -wi-a----- 4.00m

node1: lvremove -y vg/lv1 vg/lv2
  LV locked by other host: vg/lv2

(lvremove removed neither of the LVs, but it freed
the lock for lv1, which could have been removed
except for the proper locking failure on lv2.)

node1: lvs
  lv1  test -wi------- 4.00m
  lv2  test -wi------- 4.00m

node1: lvremove -y vg/lv1
LV vg/lv1 lock failed: error -221

(The lock for lv1 is gone, so nothing can be done with it.)
2024-10-16 13:18:14 -05:00
..
activate cleanup: typos in comments 2024-08-30 16:51:15 +02:00
cache cleanup: typos in comments 2024-08-30 16:51:15 +02:00
cache_segtype metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
commands cleanup: fix typos 2024-09-27 13:42:45 +02:00
config lvmlockd: configurable sanlock lease sizes on 4K disks 2024-09-27 17:59:03 -05:00
datastruct cleanup: eliminate unused assign 2021-03-11 00:18:01 +01:00
device device_id: fix segfault if devices file has PVID=. 2024-10-15 10:58:16 +02:00
display cleanup: typos in comments 2024-08-30 16:51:15 +02:00
error error: try with modprobe 2024-05-27 15:16:26 +02:00
filters cleanup: typos in comments 2024-08-30 16:51:15 +02:00
format_text metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
integrity metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
label cleanup: typos in comments 2024-08-30 16:51:15 +02:00
locking lvremove: fix failed remove of all LVs in shared VG 2024-10-16 13:18:14 -05:00
log cov: annotate 2024-09-30 15:00:03 +02:00
lvmpolld cleanup: typos in logging 2024-08-30 16:51:15 +02:00
metadata lvremove: fix failed remove of all LVs in shared VG 2024-10-16 13:18:14 -05:00
mirror metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
misc cleanup: typos in comments 2024-08-30 16:51:15 +02:00
mm memlock: use value of 0 to disable memory locking 2024-09-27 13:42:45 +02:00
notify cleanup: fix typos 2024-09-27 13:42:45 +02:00
properties cleanup: typos in comments 2024-08-30 16:51:15 +02:00
raid metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
report vdo: depcreate unused settings 2024-09-26 16:25:12 +02:00
snapshot metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
striped metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
thin metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
unknown metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
uuid cleanup: use _ for static var 2024-06-03 15:30:05 +02:00
vdo vdo: depcreate unused settings 2024-09-26 16:25:12 +02:00
writecache metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
zero const: _ops segtype handler 2024-05-04 01:01:57 +02:00
Makefile.in devices: factor common list functions 2022-11-07 11:38:46 -06:00