Bug 862085 - automatically filter disks with imsm or ddf superblocks
automatically filter disks with imsm or ddf superblocks
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
rawhide
Unspecified Linux
medium Severity low
: ---
: ---
Assigned To: Peter Rajnoha
Fedora Extras Quality Assurance
: FutureFeature
Depends On: 1067350
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-01 16:02 EDT by Miquel van Smoorenburg
Modified: 2015-01-30 12:29 EST (History)
12 users (show)

See Also:
Fixed In Version: lvm2-2.02.116-3.fc22
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-30 12:29:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
PATCH (7.69 KB, patch)
2012-10-01 16:02 EDT, Miquel van Smoorenburg
no flags Details | Diff

  None (edit)
Description Miquel van Smoorenburg 2012-10-01 16:02:31 EDT
Created attachment 619982 [details]
PATCH

Description of problem:

lvm.conf has a setting called md_component_detection, which makes lvm
ignore disks with a linux "md" raid superblock. This patch adds detection
of more raid superblock formats, ddf and imsm.

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

LVM2-2.02.97

Additional info:

This was discussed on the linux-lvm mailinglist in Spetember 2012, Subject "automatically filter disks with imsm or ddf superblocks". This is v3 of the patch, as posted on 22-09-2012.
Comment 1 Zdenek Kabelac 2012-10-19 05:01:39 EDT
Is this patch ok ?
Are we going to add more and more built-in detections or we outsource this into util-linux binaries ?
Comment 2 Fedora End Of Life 2013-04-03 12:00:45 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 3 Dmitrijs Ledkovs 2013-12-02 06:30:52 EST
In util-linux/libblkid/src/superblocks/ there are already checks for both "DDF" and "ISW" (aka Intel Matrix / Intel Software Raid / Rapid Storage / etc.) in ddf_raid.c and isw_raid.c respectively.

Thus one can query for superblock types with libblkid.
Comment 4 Zdenek Kabelac 2013-12-02 06:34:25 EST
It's more complex.

lvm2 should probably be able to use  udev database here, which already keeps the info - so as soon as  udev is used - it should be used for more things than just obtaining list of devices.
Comment 5 Peter Rajnoha 2013-12-02 07:25:13 EST
(In reply to Zdenek Kabelac from comment #4)
> It's more complex.
> 
> lvm2 should probably be able to use  udev database here, which already keeps
> the info - so as soon as  udev is used - it should be used for more things
> than just obtaining list of devices.

...I agree - it would make the existing filtering even faster (md, mpath,partitioned dev) as the scan and variables are already set in udev (based on blkid call and some additional processing by each subsystem's rules).

Also, the mpath filtering would work even better as we don't know whether the device is an mpath member or not until the mpath device is fully set up. But mpath itself already knows which device is going to be a part of the top-level mpath device and it marks such devices in udev already.

So these are the arguments for giving the udev db a try I think... The only danger here is that sometimes we encountered problems while reading udev db with older versions of libudev where races were still present directly in libudev interface. But we could just enable it for those newer versions, of course.
Comment 6 Alasdair Kergon 2014-02-05 17:42:01 EST
There've been some enhancements since that last comment was written.
Let's re-evaluate the situation.
Comment 7 Miquel van Smoorenburg 2014-02-06 03:45:32 EST
I can see the appeal of using libblkid or similar instead of one-off solutions like this patch. I see that libblkid based wiping has already been added in dev/dev-type.c. 

Should similar support be added to filters/filter-md.c ? Or a new filters/filter-blkid.c ?
Comment 8 Peter Rajnoha 2014-02-06 03:59:47 EST
Yes, we'd definitely like to reuse the existing information in the system instead of doing the scans again (there's at least the blkid cache as well as udev information that already has what we need). I'll certainly revisit this - but at the moment I'm a bit overloaded with other high prio bugs to resolve, unfortunately. I'll try to get to this as soon as possible - this should be easy to add so once I've more time... I should be able to prepare patches for this quickly then.
Comment 9 Peter Rajnoha 2015-01-30 07:55:16 EST
The patchset that uses udev db info for filtering is now upstream (lvm2 version 2.02.116). To use this feature, you need to enable it by setting following items in lvm.conf:

  devices {
    external_device_info_source = "udev"
    fw_raid_component_detection = 1
  }

Note You need to log in before you can comment on or make changes to this bug.