Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 147049 Details for
Bug 207372
partprobe in RHEL 4 hardlocks the system
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Sun disklabel reading code that won't lock partprobe(8)
parted-1.6.19-partprobe-lock-sun-disklabel.patch (text/plain), 6.36 KB, created by
David Cantrell
on 2007-01-31 21:00:06 UTC
(
hide
)
Description:
Sun disklabel reading code that won't lock partprobe(8)
Filename:
MIME Type:
Creator:
David Cantrell
Created:
2007-01-31 21:00:06 UTC
Size:
6.36 KB
patch
obsolete
>--- parted-1.6.19/libparted/disk_sun.c.partprobe-lock 2004-08-15 18:45:28.000000000 -0400 >+++ parted-1.6.19/libparted/disk_sun.c 2007-01-31 15:37:13.000000000 -0500 >@@ -1,7 +1,7 @@ > /* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- > > libparted - a library for manipulating disk partitions >- Copyright (C) 2000, 2001 Free Software Foundation, Inc. >+ Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by >@@ -15,7 +15,7 @@ > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software >- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA > > Contributor: Ben Collins <bcollins@debian.org> > */ >@@ -58,7 +58,7 @@ > } __attribute__ ((packed)) SunPartitionInfo; > > typedef struct { >- u_int8_t info[128]; /* Informative text string */ >+ char info[128]; /* Informative text string */ > u_int8_t spare0[14]; > SunPartitionInfo infos[SUN_DISK_MAXPARTITIONS]; > u_int8_t spare1[246]; /* Boot information etc. */ >@@ -117,7 +117,7 @@ > } > > static int >-sun_probe (PedDevice *dev) >+sun_probe (const PedDevice *dev) > { > PedDiskType* disk_type; > SunRawLabel label; >@@ -125,6 +125,9 @@ > > PED_ASSERT (dev != NULL, return 0); > >+ if (dev->sector_size != 512) >+ return 0; >+ > if (!ped_device_read (dev, &label, 0, 1)) > return 0; > >@@ -163,10 +166,13 @@ > #endif /* !DISCOVER_ONLY */ > > static PedDisk* >-sun_alloc (PedDevice* dev) >+sun_alloc (const PedDevice* dev) > { > PedDisk* disk; > SunRawLabel* label; >+ SunDiskData* sun_specific; >+ PedCHSGeometry* bios_geom = &((PedDevice*)dev)->bios_geom; >+ PedSector cyl_size = bios_geom->sectors * bios_geom->heads; > > disk = _ped_disk_alloc (dev, &sun_disk_type); > if (!disk) >@@ -175,34 +181,37 @@ > disk->disk_specific = (SunDiskData*) ped_malloc (sizeof (SunDiskData)); > if (!disk->disk_specific) > goto error_free_disk; >+ sun_specific = (SunDiskData*) disk->disk_specific; > >- label = &((SunDiskData*) disk->disk_specific)->raw_label; >+ bios_geom->cylinders = dev->length / cyl_size; >+ sun_specific->length = bios_geom->cylinders * cyl_size; > >+ label = &sun_specific->raw_label; > memset(label, 0, sizeof(SunRawLabel)); > >- /* util-linux's fdisk asks about these...I'm just going to use >- defaults since most people do anyway...sue me. */ >+ /* #gentoo-sparc people agree that nacyl = 0 is the best option */ > label->magic = PED_CPU_TO_BE16 (SUN_DISK_MAGIC); >- label->nacyl = PED_CPU_TO_BE16 (2); >- label->pcylcount = PED_CPU_TO_BE16 (dev->hw_geom.cylinders); >+ label->nacyl = 0; >+ label->pcylcount = PED_CPU_TO_BE16 (bios_geom->cylinders); > label->rspeed = PED_CPU_TO_BE16 (5400); > label->ilfact = PED_CPU_TO_BE16 (1); >- label->sparecyl = PED_CPU_TO_BE16 (dev->hw_geom.sectors); >- label->ntrks = PED_CPU_TO_BE16 (dev->hw_geom.heads); >- label->nsect = PED_CPU_TO_BE16 (dev->hw_geom.sectors); >- label->ncyl = PED_CPU_TO_BE16 (dev->hw_geom.cylinders - 2); >+ label->sparecyl = 0; >+ label->ntrks = PED_CPU_TO_BE16 (bios_geom->heads); >+ label->nsect = PED_CPU_TO_BE16 (bios_geom->sectors); >+ label->ncyl = PED_CPU_TO_BE16 (bios_geom->cylinders - 0); > > /* Add a whole disk partition at a minimum */ > label->infos[WHOLE_DISK_PART].id = WHOLE_DISK_ID; > label->partitions[WHOLE_DISK_PART].start_cylinder = 0; > label->partitions[WHOLE_DISK_PART].num_sectors = >- PED_CPU_TO_BE32((dev->hw_geom.cylinders-2) >- * dev->hw_geom.heads * dev->hw_geom.sectors); >+ PED_CPU_TO_BE32(bios_geom->cylinders * cyl_size); > > /* Now a neato string to describe this label */ > snprintf(label->info, sizeof(label->info) - 1, >- "GNU Parted Custom cyl %d alt 2 hd %d sec %d", >- PED_BE16_TO_CPU(label->ncyl), PED_BE16_TO_CPU(label->ntrks), >+ "GNU Parted Custom cyl %d alt %d hd %d sec %d", >+ PED_BE16_TO_CPU(label->ncyl), >+ PED_BE16_TO_CPU(label->nacyl), >+ PED_BE16_TO_CPU(label->ntrks), > PED_BE16_TO_CPU(label->nsect)); > > sun_compute_checksum(label); >@@ -252,12 +261,13 @@ > if (ped_exception_throw ( > PED_EXCEPTION_WARNING, > PED_EXCEPTION_IGNORE_CANCEL, >- _("The disk CHS geometry (%d,%d,%d) does not " >- "match the geometry stored on the disk " >- "label (%d,%d,%d)."), >- dev->hw_geom.cylinders, >- dev->hw_geom.heads, >- dev->hw_geom.sectors, >+ _("The disk CHS geometry (%d,%d,%d) reported " >+ "by the operating system does not match " >+ "the geometry stored on the disk label " >+ "(%d,%d,%d)."), >+ dev->bios_geom.cylinders, >+ dev->bios_geom.heads, >+ dev->bios_geom.sectors, > PED_BE16_TO_CPU(label->pcylcount), > PED_BE16_TO_CPU(label->ntrks), > PED_BE16_TO_CPU(label->nsect)) >@@ -309,8 +319,7 @@ > goto error; > > block = disk->dev->bios_geom.sectors * disk->dev->bios_geom.heads; >- disk_data->length = block * (disk->dev->bios_geom.cylinders >- - PED_BE16_TO_CPU(label->nacyl)); >+ disk_data->length = block * disk->dev->bios_geom.cylinders; > > for (i = 0; i < SUN_DISK_MAXPARTITIONS; i++) { > if (!PED_BE32_TO_CPU(label->partitions[i].num_sectors)) >@@ -352,7 +361,7 @@ > > #ifndef DISCOVER_ONLY > static void >-_probe_and_add_use_old_info (PedDisk* disk) >+_probe_and_use_old_info (PedDisk* disk) > { > SunDiskData* sun_specific; > SunRawLabel old_label; >@@ -373,13 +382,12 @@ > SunPartitionData* sun_data; > SunDiskData* disk_data; > PedPartition* part; >- PedSector length; > int i; > > PED_ASSERT (disk != NULL, return 0); > PED_ASSERT (disk->dev != NULL, return 0); > >- _probe_and_add_use_old_info (disk); >+ _probe_and_use_old_info (disk); > > disk_data = (SunDiskData*) disk->disk_specific; > label = &disk_data->raw_label; >@@ -425,9 +433,18 @@ > smaller than it really is, but we'll have that problem even if we > don't do this. */ > >+ if (disk->dev->bios_geom.cylinders > 65536) { >+ ped_exception_throw ( >+ PED_EXCEPTION_WARNING, >+ PED_EXCEPTION_IGNORE, >+ _("The disk has %d cylinders, which is greater than " >+ "the maximum of 65536."), >+ disk->dev->bios_geom.cylinders); >+ } >+ > label->pcylcount = PED_CPU_TO_BE16 (disk->dev->bios_geom.cylinders); > label->ncyl = PED_CPU_TO_BE16 (disk->dev->bios_geom.cylinders >- - PED_BE32_TO_CPU(label->nacyl)); >+ - PED_BE16_TO_CPU (label->nacyl)); > > sun_compute_checksum (label); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207372
:
136778
|
136779
|
136780
|
136781
|
136859
| 147049