FreeBSD Bugzilla – Attachment 172443 Details for
Bug 144234
[zfs] Cannot boot machine with recent gptzfsboot code [regression]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for HP gptzfsboot LBA read error
gptzfsboot_hp_fix.patch (text/plain), 2.26 KB, created by
Allan Jude
on 2016-07-12 23:25:38 UTC
(
hide
)
Description:
Fix for HP gptzfsboot LBA read error
Filename:
MIME Type:
Creator:
Allan Jude
Created:
2016-07-12 23:25:38 UTC
Size:
2.26 KB
patch
obsolete
>Index: sys/boot/i386/zfsboot/zfsboot.c >=================================================================== >--- sys/boot/i386/zfsboot/zfsboot.c (revision 302689) >+++ sys/boot/i386/zfsboot/zfsboot.c (working copy) >@@ -391,7 +391,7 @@ > return (newdsk); > } > >-static void >+static int > probe_drive(struct dsk *dsk) > { > #ifdef GPT >@@ -412,7 +412,7 @@ > * If we find a vdev on the whole disk, stop here. > */ > if (vdev_probe(vdev_read, dsk, NULL) == 0) >- return; >+ return (0); > > #ifdef LOADER_GELI_SUPPORT > /* >@@ -428,7 +428,7 @@ > if (geli_taste(vdev_read, dsk, elba) == 0) { > if (geli_passphrase(&gelipw, dsk->unit, ':', 0, dsk) == 0) { > if (vdev_probe(vdev_read, dsk, NULL) == 0) { >- return; >+ return (0); > } > } > } >@@ -442,7 +442,7 @@ > * First check for GPT. > */ > if (drvread(dsk, sec, 1, 1)) { >- return; >+ return (1); > } > memcpy(&hdr, sec, sizeof(hdr)); > if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || >@@ -465,7 +465,7 @@ > while (slba < elba) { > dsk->start = 0; > if (drvread(dsk, sec, slba, 1)) >- return; >+ return (1); > for (part = 0; part < entries_per_sec; part++) { > ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); > if (memcmp(&ent->ent_type, &freebsd_zfs_uuid, >@@ -502,12 +502,12 @@ > } > slba++; > } >- return; >+ return (0); > trymbr: > #endif /* GPT */ > > if (drvread(dsk, sec, DOSBBSECTOR, 1)) >- return; >+ return (1); > dp = (void *)(sec + DOSPARTOFF); > > for (i = 0; i < NDOSPART; i++) { >@@ -537,12 +537,14 @@ > } > #endif /* LOADER_GELI_SUPPORT */ > } >+ >+ return (0); > } > > int > main(void) > { >- int autoboot, i; >+ int autoboot, i, err; > dnode_phys_t dn; > off_t off; > struct dsk *dsk; >@@ -591,7 +593,7 @@ > * Probe the boot drive first - we will try to boot from whatever > * pool we find on that drive. > */ >- probe_drive(dsk); >+ err = probe_drive(dsk); > > /* > * Probe the rest of the drives that the bios knows about. This >@@ -604,7 +606,8 @@ > for (i = 0; i < MAXBDDEV; i++) > #endif > { >- if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) >+ /* Only skip the boot drive if reading from it did not fail */ >+ if (err == 0 && (i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) > continue; > > if (!int13probe(i | DRV_HARD))
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 144234
:
146387
|
146392
|
146742
|
159025
| 172443 |
197090