diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-09-25 22:42:53 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-09-25 22:54:07 +0200 |
commit | e2eb1dc501aca4b11997b31978c9ce62916a7c98 (patch) | |
tree | c0ddd9d327c9f1bf1af772dedb783df9c13042cf | |
parent | fc9e7328113fb3c1563909cce3abde329684c637 (diff) | |
download | lvm2-e2eb1dc501aca4b11997b31978c9ce62916a7c98.tar.gz |
thin: no delete message for device_id 0
Since we always use device_id > 0, we could use
device_id == 0 to actually mark thinLV as an
LV we want to remove without delete message.
-rw-r--r-- | lib/metadata/pool_manip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c index 23b5b63ba..a9dc6116d 100644 --- a/lib/metadata/pool_manip.c +++ b/lib/metadata/pool_manip.c @@ -310,7 +310,8 @@ int detach_pool_lv(struct lv_segment *seg) if (!detach_thin_external_origin(seg)) return_0; - if (!attach_pool_message(first_seg(seg->pool_lv), + if (seg->device_id && /* Only thins with device_id > 0 can be deleted */ + !attach_pool_message(first_seg(seg->pool_lv), DM_THIN_MESSAGE_DELETE, NULL, seg->device_id, no_update)) return_0; |