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 294617 Details for
Bug 432441
Parted assertion failure when installing to DASD emulated FCP device
[?]
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]
Backport relevant changes from parted-1.8
parted-1.6.19-msdos-geom.patch (text/plain), 2.76 KB, created by
Brad Hinson
on 2008-02-12 02:02:57 UTC
(
hide
)
Description:
Backport relevant changes from parted-1.8
Filename:
MIME Type:
Creator:
Brad Hinson
Created:
2008-02-12 02:02:57 UTC
Size:
2.76 KB
patch
obsolete
>--- parted-1.6.19/libparted/disk_dos.c.orig >+++ parted-1.6.19/libparted/disk_dos.c >@@ -158,6 +158,9 @@ > > PED_ASSERT (dev != NULL, return 0); > >+ if (dev->sector_size != 512) >+ return 0; >+ > if (!ped_device_read (dev, &part_table, 0, 1)) > return 0; > >@@ -484,6 +487,7 @@ > RawCHS* end_chs; > PedSector c, h, s, a, a_; /* start */ > PedSector C, H, S, A, A_; /* end */ >+ PedSector dont_overflow, denum; > PedSector cyl_size, head_size; > PedSector cylinders, heads, sectors; > >@@ -514,7 +518,12 @@ > return 0; > if (c > C) > return 0; >- if (A > MAX_CHS_CYLINDER * 255 * 63) >+ >+ /* If no geometry is feasible, then don't even bother. >+ * Useful for eliminating assertions for broken partition >+ * tables generated by Norton Ghost et al. >+ */ >+ if (A > (C+1) * 255 * 63) > return 0; > > /* Not enough information. In theory, we can do better. Should we? */ >@@ -523,34 +532,45 @@ > if (C == 0) > return 0; > >- /* STEP ONE: find cyl_size */ >- if (h == 0 && c > 0) { >- /* If the matrix looks like this, then it's easy! >- * [ c 0 ] >- * [ C H ] >- */ >- cyl_size = a_ / c; >- } else if (h > 0) { >- /* if h > 0, we can do R2 -> R2 - H/h R1 to get: >- * >- * [ c h ] = [ a_ ] >- * [ X 0 ] = [ Y ] >- * >- * Then, cyl_size = Y / X >- * >- * However, if H/h isn't an integer, this isn't going >- * to work out nicely, so the partition table must >- * be inconsistent. >- */ >- if (H % h != 0) >- return 0; >- if (C == H/h * c) >- return 0; >- cyl_size = (A_ - H/h * a_) / (C - H/h * c); >- } else { >- /* h == 0 && c == 0: not enough information */ >+ /* Calculate the maximum number that can be multiplied by >+ * any head count without overflowing a PedSector >+ * 2^8 = 256, 8 bits + 1(sign bit) = 9 >+ */ >+ dont_overflow = 1; >+ dont_overflow <<= (8*sizeof(dont_overflow)) - 9; >+ dont_overflow--; >+ >+ if (a_ > dont_overflow || A_ > dont_overflow) >+ return 0; >+ >+ /* The matrix is solved by : >+ * >+ * [ c h | a_] R1 >+ * [ C H | A_] R2 >+ * >+ * (cH - Ch) cyl_size = a_H - A_h H R1 - h R2 >+ * => (if cH - Ch != 0) cyl_size = (a_H - A_h) / (cH - Ch) >+ * >+ * (Hc - hC) head_size = A_c - a_C c R2 - C R1 >+ * => (if cH - Ch != 0) head_size = (A_c - a_C) / (cH - Ch) >+ * >+ * But this calculation of head_size would need >+ * not overflowing A_c or a_C >+ * So substitution is use instead, to minimize dimension >+ * of temporary results : >+ * >+ * If h != 0 : head_size = ( a_ - c cyl_size ) / h >+ * If H != 0 : head_size = ( A_ - C cyl_size ) / H >+ * >+ */ >+ denum = c * H - C * h; >+ if (denum == 0) >+ return 0; >+ >+ cyl_size = (a_*H - A_*h) / denum; >+ /* Check for non integer result */ >+ if (cyl_size * denum != a_*H - A_*h) > return 0; >- } > > PED_ASSERT (cyl_size > 0, return 0); > PED_ASSERT (cyl_size <= 255 * 63, return 0);
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 432441
: 294617 |
294698