Bug 2120973

Summary: Don't trigger udev with --test
Product: [Community] LVM and device-mapper Reporter: Marius Vollmer <mvollmer>
Component: lvm2Assignee: LVM Team <lvm-team>
lvm2 sub component: Metadata QA Contact: cluster-qe <cluster-qe>
Status: NEW --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: unspecifiedFlags: pm-rhel: lvm-technical-solution?
pm-rhel: lvm-test-coverage?
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch
none
Proposed patch none

Description Marius Vollmer 2022-08-24 08:27:39 UTC
Created attachment 1907329 [details]
Proposed patch

Description of problem:

When using "lvcreate --test", some udev events are still triggered.

Version-Release number of selected component (if applicable):
v2_03_16

How reproducible:
Always

Steps to Reproduce:
1. udevadm monitor
2. lvcreate --test vgroup0 -n lvol0 -L10M

Actual results:
udev CHANGE events happen for the PVs of vgroup0

Expected results:
No CHANGE events happen.

Comment 1 Marius Vollmer 2022-08-24 09:45:07 UTC
Created attachment 1907348 [details]
Proposed patch

Comment 2 Zdenek Kabelac 2022-08-30 17:00:12 UTC
Well this is not so easy  -  the whole point of '--test' is to check as close to 'reality' how the command can proceed - and one part of testing is to check write mode is accessible - of course complex target like thin-pool are really hard to check this way - so the --test environment at some point becomes less useful.

Note - running udev change event is not considered harmful and again it's more closer to the actual command process if it would be executed directly.

I guess you are trying to misuse lvcreate with -vvvv for some 'other then designed' support  (BZ #2121015)

ATM attached patch is not acceptable as it would break the real purpose of --test option.

But there could be some more thinking about some way how to expose possible 'allocations' made by command since also 'lvconvert' can be doing allocations - so the universal option needs some brainstorming - but it's related to the better allocation internal API that would then be possibly better accessible for such queries
(as lvm2 was simply not designed for such use case).