Skip to content

Commit

Permalink
6294 GRUB should try all DVAs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dankimmel authored and ahrens committed Oct 12, 2015
1 parent 35e3186 commit d94527b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions usr/src/grub/capability
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 11 additions & 10 deletions usr/src/grub/grub-0.97/stage2/fsys_zfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d94527b

Please sign in to comment.