Bug 513729

Summary: is_flag_available() for PARTITION_LINUX_SWAP fails for DOS labels
Product: [Fedora] Fedora Reporter: David Cantrell <dcantrell>
Component: partedAssignee: Hans de Goede <hdegoede>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 12CC: ddumas, dlehman, hdegoede, jgranado
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-09 21:58:43 UTC Type: ---
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
parted-1.8.8-swap-flag-on-dos-label.patch
none
parted-1.9.0-swap-flag-on-dos-label.patch none

Description David Cantrell 2009-07-24 23:57:49 UTC
Anaconda is getting this message:

    The flag 'swap' is not available for msdos disklabels.

That exception message comes from libparted.  Looking through libparted/labels/dos.c, I see that the is_flag_available() function for msdos labels returns false for swap.  Some of the code has been added by a previous patch, but it looks like the rest of the file needs to have it added.

I created a patch for 1.9.0 and 1.8.8 and asked dlehman to test it out.  It's not working from the anaconda end, but I think this is the right approach.  Can you look at it from here?

I'll attach the two patches I made.

Comment 1 David Cantrell 2009-07-24 23:58:11 UTC
Created attachment 355117 [details]
parted-1.8.8-swap-flag-on-dos-label.patch

Comment 2 David Cantrell 2009-07-24 23:58:30 UTC
Created attachment 355118 [details]
parted-1.9.0-swap-flag-on-dos-label.patch

Comment 3 Joel Andres Granados 2009-07-27 17:04:07 UTC
Seems pretty strait forward,  Thx for the patch.  You don't need the 1.8.8 anymore as upstream has officially released 1.9.0 and fedora has it from f12.  This patch will be present in 1.9.0-8

Comment 4 David Lehman 2009-10-06 01:58:15 UTC
This seems to have regressed in parted-1.9.0-14.fc12 (or earlier). Test in rawhide a week or so ago and trying to set swap on a partition results in a traceback saying the flag is unavailable on dos partition tables.

Comment 5 Hans de Goede 2009-10-06 21:16:38 UTC
David's patch for 1.9.0 did not make msdos_partition_is_flag_available return
true for the swap flag which is causing this issue.

This is fixed in parted-1.9.0-16.fc12, which is available here:
http://koji.fedoraproject.org/koji/buildinfo?buildID=135375

A tag request to get this included for the beta is here:
https://fedorahosted.org/rel-eng/ticket/2366

Comment 6 Hans de Goede 2009-10-08 10:31:53 UTC
Note I just did a parted-1.9.0-17.fc12 with another fix to Davids patch:

* Thu Oct 08 2009 Hans de Goede <hdegoede> 1.9.0-17
- Only change the partition type to 82 when setting the swap flag on dos
  labels, not when resetting it

The tag request to get this included for the beta is still here:
https://fedorahosted.org/rel-eng/ticket/2366

Comment 7 Bug Zapper 2009-11-16 11:07:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Hans de Goede 2009-12-09 21:58:43 UTC
Long fixed now, closing.