Bug 583299 - Parted should not canonicalize symlinks under /dev/mapper
Parted should not canonicalize symlinks under /dev/mapper
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: parted (Show other bugs)
13
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
anaconda_trace_hash:ad44c8cc90cd6919f...
:
: 583283 (view as bug list)
Depends On:
Blocks: F13Blocker/F13FinalBlocker
  Show dependency treegraph
 
Reported: 2010-04-17 14:31 EDT by Hans de Goede
Modified: 2010-05-03 16:35 EDT (History)
4 users (show)

See Also:
Fixed In Version: parted-2.1-6.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-03 16:35:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Hans de Goede 2010-04-17 14:31:05 EDT
+++ This bug was initially created as a clone of Bug #577824 +++

+++ This bug was initially created as a clone of Bug #576145 +++

The following was filed automatically by anaconda:
anaconda 13.21.20.1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python2.6/site-packages/parted/disk.py", line 213, in commit
    return self.__disk.commit()
  File "/usr/lib64/python2.6/site-packages/parted/decorators.py", line 30, in localeC
    ret = fn(*args, **kwds)
  File "<string>", line 2, in commit
  File "/usr/lib/anaconda/storage/formats/disklabel.py", line 245, in commit
    self.partedDisk.commit()
  File "/usr/lib/anaconda/storage/formats/disklabel.py", line 235, in destroy
    self.commit()
  File "/usr/lib/anaconda/storage/deviceaction.py", line 313, in execute
    self.origFormat.destroy()
  File "/usr/lib/anaconda/storage/devicetree.py", line 670, in processActions
    action.execute(intf=self.intf)
  File "/usr/lib/anaconda/storage/__init__.py", line 287, in doIt
    self.devicetree.processActions()
  File "/usr/lib/anaconda/packages.py", line 110, in turnOnFilesystems
    anaconda.id.storage.doIt()
  File "/usr/lib/anaconda/dispatch.py", line 205, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 126, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/gui.py", line 1396, in setScreen
    self.anaconda.dispatch.gotoNext()
  File "/usr/lib/anaconda/gui.py", line 1309, in nextClicked
    self.setScreen ()
IOException: Error opening /dev/dm-1: No such file or directory

<snip>

--- Additional comment from hdegoede@redhat.com on 2010-03-29 07:41:15 EDT ---

There are 2 issues here:

1) We should not call partedDisk.commit on non partitionable devices which
   hold a disklabel, as the partition table reload ioctl will fail.

2) We should not store /dev/dm-# device node names in actions, but
   rather /dev/mapper/xxxxx-yyyyy names, as the /dev/dm-# name can change
   when we deactivate and re-activate things.

I'm going to clone this bug, and keep this one for issue 1 (for which I'll send a patch to the list for review).

I'm going to assign issue 2 to Dave Lehman who knows that part of the code
best.

--- Additional comment from hdegoede@redhat.com on 2010-03-29 07:44:45 EDT ---

Dave,

Quoting the last comment from the cloned bug:

"2) We should not store /dev/dm-# device node names in actions, but
    rather /dev/mapper/xxxxx-yyyyy names, as the /dev/dm-# name can change
    when we deactivate and re-activate things."

Regards,

Hans

--- Additional comment from dlehman@redhat.com on 2010-03-29 12:15:05 EDT ---

We aren't storing dm-# anywhere. Parted is reporting dm-# because it has resolved the /dev/mapper/%name symlink to the real device name which is dm-#.

--- Additional comment from hdegoede@redhat.com on 2010-03-29 13:50:16 EDT ---

(In reply to comment #4)
> We aren't storing dm-# anywhere. Parted is reporting dm-# because it has
> resolved the /dev/mapper/%name symlink to the real device name which is dm-#.    

You are probably right, but even then we still have an issue, parted is returning the following error:
IOException: Error opening /dev/dm-1: No such file or directory

This means that the symlink is pointing to a non existing device node ?

Maybe some issue with the new udev driven lvm stuff ?

Note that the:

        if not os.access(self.device, os.W_OK):
            raise DeviceFormatError("device path does not exist")

check in disklabel.py does not trigger, maybe that is only checking the
existence of the symlink ?

Re-opening this so that it does not fall through the cracks (sorry).

--- Additional comment from akozumpl@redhat.com on 2010-04-01 09:54:30 EDT ---

One thing is for sure: according to the traceback we give parted the correct name of the device:

DiskLabel.destroy: device: /dev/mapper/vg00-lvRHEL5 ; status: True ; type: disklabel ;
12

--- Additional comment from akozumpl@redhat.com on 2010-04-02 08:50:43 EDT ---

I have a reproducing vmware image and there's actually no symlinks pointing to /dev/dm-2. So I am still wondering.

--- Additional comment from akozumpl@redhat.com on 2010-04-06 05:13:40 EDT ---

Here's whats happening: (it is only reproducible without Hans's patch for 576145, but it really can be an issue now that /dev/mapper/VolGrou00-* are udev manged symlinks)

1) during storageinit we initialize DiskLabel's parted devices through a call to pyparted:
self._partedDevice = parted.Device(path=self.device)

where self.device is '/dev/mapper/VolGroup00-lve1' links to '/dev/dm-2'

2) pyparted talks to libparted, it calls ped_device_get(path)
the first think ped_device_get does is to canonicalize the path. from then on it works with and remembers only the absolute path.

3) during the enablefilesystems step, at the point where we try to destroy disklabel on /dev/mapper/VolGroup00-lve1, /dev/mapper/VolGroup00-lve1 now points to /dev/dm-0 as the other lvm devices were deactivated/disappeared in the meantime (is this the correct behavior?) but /dev/dm-2 that libparted remembers no longer exists.

The fix should be to reinitialize disklabel._partedDevice whenever the given lvm is reactivated to keep the internal libparted object consistent with the disklabel object.

--- Additional comment from hdegoede@redhat.com on 2010-04-06 11:40:05 EDT ---

This is fixed in parted-2.1-6.el6, moving to modified.
Comment 1 Hans de Goede 2010-04-17 14:31:27 EDT
*** Bug 583283 has been marked as a duplicate of this bug. ***
Comment 2 Hans de Goede 2010-04-17 14:33:38 EDT
Proposing this as F13Blocker as Fedora users / F-13 testers are unable to install F13 because of this, see bug 583283. Note we already have a fix available (just need to move the new parted from updates-testing to F-13).
Comment 3 Fedora Update System 2010-04-17 14:34:34 EDT
parted-2.1-6.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/parted-2.1-6.fc13
Comment 4 Adam Williamson 2010-04-23 15:17:57 EDT
Discussed at today's blocker meeting. Hans, what's the actual scenario where you'd hit this bug - what kind of hardware / partition layout do you need to run into it? We can't tell if this should be a blocker, or test the fix, without that info.  Thanks!



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 5 Hans de Goede 2010-04-25 10:23:26 EDT
The scenario here is a bit hard to trigger, what should work to reliable trigger it is, do an install with custom partitioning creating multiple LV's and leaving disk space for another install.

After the install see which LV got which /dev/dm-# coupled to it,

Do another install using custom partitioning, And remove an lv which uses a /dev/dm-# other then /dev/dm-0, other then that it should not remove any existing partitions / LV's.

Then proceed to write changes, and things should go boom.

Note that:
1) The fix for this is pretty straight forward and low risk
2) The fix for this is already upstream
3) The fix for this is already in RHEL-6, and has not caused any problems during
   RHEL-6 testing sofar
4) The fix for this is included into the (newer) parted fedora-13 package, which
   is needed to fix 534066, which has been granted F13 Blocker status.
Comment 6 Adam Williamson 2010-04-26 20:06:46 EDT
Thanks for the info. Just in case, if you're thinking the bug needs to be declared a blocker for us to accept the fix, that's not the case: we're not yet at the stage where only blocker-fixing changes are accepted.

It's a tricky one to decide if it's a blocker or not, but I'm sure we'll be taking the package that fixes it anyway.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 7 Adam Williamson 2010-05-03 16:35:18 EDT
This is marked as fixed in 2.1-6.fc13, and 2.1-7.fc13 was pushed to stable recently, so I'm closing it.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

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