Bug 513729 - is_flag_available() for PARTITION_LINUX_SWAP fails for DOS labels
is_flag_available() for PARTITION_LINUX_SWAP fails for DOS labels
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: parted (Show other bugs)
12
All Linux
high Severity high
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-24 19:57 EDT by David Cantrell
Modified: 2009-12-09 16:58 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-09 16:58:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
parted-1.8.8-swap-flag-on-dos-label.patch (3.32 KB, patch)
2009-07-24 19:58 EDT, David Cantrell
no flags Details | Diff
parted-1.9.0-swap-flag-on-dos-label.patch (3.33 KB, patch)
2009-07-24 19:58 EDT, David Cantrell
no flags Details | Diff

  None (edit)
Description David Cantrell 2009-07-24 19:57:49 EDT
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 19:58:11 EDT
Created attachment 355117 [details]
parted-1.8.8-swap-flag-on-dos-label.patch
Comment 2 David Cantrell 2009-07-24 19:58:30 EDT
Created attachment 355118 [details]
parted-1.9.0-swap-flag-on-dos-label.patch
Comment 3 Joel Andres Granados 2009-07-27 13:04:07 EDT
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-05 21:58:15 EDT
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 17:16:38 EDT
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 06:31:53 EDT
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@redhat.com> 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 06:07:09 EST
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 16:58:43 EST
Long fixed now, closing.

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