All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Asleson <tasleson@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvmdbusd: Handle PV signature copy
Date: Thu, 20 Oct 2022 20:11:38 +0000 (GMT)	[thread overview]
Message-ID: <20221020201138.A1952384BC20@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=94dde5769984c5ede211d122cc7392a26f8dbef4
Commit:        94dde5769984c5ede211d122cc7392a26f8dbef4
Parent:        736547e7bb306236e1ea6f4d8d9185ee0ab69638
Author:        Tony Asleson <tasleson@redhat.com>
AuthorDate:    Thu Oct 20 10:46:51 2022 -0500
Committer:     Tony Asleson <tasleson@redhat.com>
CommitterDate: Thu Oct 20 15:10:35 2022 -0500

lvmdbusd: Handle PV signature copy

If something manually copies a PV signature to a block device we will
miss it.  Handle this case too.
---
 daemons/lvmdbusd/udevwatch.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/daemons/lvmdbusd/udevwatch.py b/daemons/lvmdbusd/udevwatch.py
index 237ff17e8..7ee7c9d1c 100644
--- a/daemons/lvmdbusd/udevwatch.py
+++ b/daemons/lvmdbusd/udevwatch.py
@@ -59,9 +59,13 @@ def filter_event(action, device):
 	if 'ID_FS_TYPE' in device:
 		fs_type_new = device['ID_FS_TYPE']
 		if 'LVM' in fs_type_new:
-			# Let's skip udev events for LVM devices as we should be handling them
-			# with the dbus notifications.
-			pass
+			# If we get a lvm related udev event for a block device
+			# we don't know about, it's either a pvcreate which we
+			# would handle with the dbus notification or something
+			# copied a pv signature onto a block device, this is
+			# required to catch the latter.
+			if not cfg.om.get_object_by_lvm_id(device['DEVNAME']):
+				refresh = True
 		elif fs_type_new == '':
 			# Check to see if the device was one we knew about
 			if 'DEVNAME' in device:


                 reply	other threads:[~2022-10-20 20:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221020201138.A1952384BC20@sourceware.org \
    --to=tasleson@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.