summaryrefslogtreecommitdiff
path: root/usr/src/grub
diff options
context:
space:
mode:
authorDan Kimmel <dan.kimmel@delphix.com>2015-10-12 12:00:13 -0700
committerMatthew Ahrens <mahrens@delphix.com>2015-10-12 12:00:13 -0700
commitd94527b3280cbf89d5360b28aff9e822cd79d0e6 (patch)
treeb384fcdec35ec498dcd74ad27b47810b5c3b7624 /usr/src/grub
parent35e3186315034c3d3ed09393825a8d08a1a7f655 (diff)
downloadillumos-joyent-d94527b3280cbf89d5360b28aff9e822cd79d0e6.tar.gz
6294 GRUB should try all DVAs
Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/grub')
-rw-r--r--usr/src/grub/capability4
-rw-r--r--usr/src/grub/grub-0.97/stage2/fsys_zfs.c21
2 files changed, 13 insertions, 12 deletions
diff --git a/usr/src/grub/capability b/usr/src/grub/capability
index 12d0ea054a..72f4bf9b83 100644
--- a/usr/src/grub/capability
+++ b/usr/src/grub/capability
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
# Copyright 2013 Saso Kiselkov. All rights reserved.
#
# This file defines the current capabilities of GRUB over and above that
@@ -30,7 +30,7 @@
# GRUB necessitating that the boot blocks be reinstalled for that fix or
# enhancement to take effect.
#
-VERSION=25
+VERSION=26
dboot
xVM
zfs
diff --git a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
index 019fbc76c6..8c0d137e42 100644
--- a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
+++ b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
@@ -23,7 +23,7 @@
*/
/*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
@@ -368,17 +368,23 @@ zio_read_data(blkptr_t *bp, void *buf, char *stack)
continue;
if (DVA_GET_GANG(&bp->blk_dva[i])) {
- if (zio_read_gang(bp, &bp->blk_dva[i], buf, stack) == 0)
- return (0);
+ if (zio_read_gang(bp, &bp->blk_dva[i], buf, stack) != 0)
+ continue;
} else {
/* read in a data block */
offset = DVA_GET_OFFSET(&bp->blk_dva[i]);
sector = DVA_OFFSET_TO_PHYS_SECTOR(offset);
- if (devread(sector, 0, psize, buf) != 0)
- return (0);
+ if (devread(sector, 0, psize, buf) == 0)
+ continue;
+ }
+
+ /* verify that the checksum matches */
+ if (zio_checksum_verify(bp, buf, psize) == 0) {
+ return (0);
}
}
+ grub_printf("could not read block due to EIO or ECKSUM\n");
return (1);
}
@@ -499,11 +505,6 @@ zio_read(blkptr_t *bp, void *buf, char *stack)
return (ERR_FSYS_CORRUPT);
}
- if (zio_checksum_verify(bp, buf, psize) != 0) {
- grub_printf("checksum verification failed\n");
- return (ERR_FSYS_CORRUPT);
- }
-
if (comp != ZIO_COMPRESS_OFF) {
if (decomp_table[comp].decomp_func(buf, retbuf, psize,
lsize) != 0) {