Deleted Added
full compact
vdev_raidz.c (247187) vdev_raidz.c (249195)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2012 by Delphix. All rights reserved.
24 * Copyright (c) 2013 by Delphix. All rights reserved.
25 */
26
27#include <sys/zfs_context.h>
28#include <sys/spa.h>
29#include <sys/vdev_impl.h>
30#include <sys/zio.h>
31#include <sys/zio_checksum.h>
32#include <sys/fs/zfs.h>

--- 1427 unchanged lines hidden (view full) ---

1460 int lasterror = 0;
1461 int numerrors = 0;
1462
1463 ASSERT(nparity > 0);
1464
1465 if (nparity > VDEV_RAIDZ_MAXPARITY ||
1466 vd->vdev_children < nparity + 1) {
1467 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
25 */
26
27#include <sys/zfs_context.h>
28#include <sys/spa.h>
29#include <sys/vdev_impl.h>
30#include <sys/zio.h>
31#include <sys/zio_checksum.h>
32#include <sys/fs/zfs.h>

--- 1427 unchanged lines hidden (view full) ---

1460 int lasterror = 0;
1461 int numerrors = 0;
1462
1463 ASSERT(nparity > 0);
1464
1465 if (nparity > VDEV_RAIDZ_MAXPARITY ||
1466 vd->vdev_children < nparity + 1) {
1467 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
1468 return (EINVAL);
1468 return (SET_ERROR(EINVAL));
1469 }
1470
1471 vdev_open_children(vd);
1472
1473 for (c = 0; c < vd->vdev_children; c++) {
1474 cvd = vd->vdev_child[c];
1475
1476 if (cvd->vdev_open_error != 0) {

--- 120 unchanged lines hidden (view full) ---

1597 for (c = rm->rm_cols - 1; c >= 0; c--) {
1598 rc = &rm->rm_col[c];
1599 cvd = vd->vdev_child[rc->rc_devidx];
1600 if (!vdev_readable(cvd)) {
1601 if (c >= rm->rm_firstdatacol)
1602 rm->rm_missingdata++;
1603 else
1604 rm->rm_missingparity++;
1469 }
1470
1471 vdev_open_children(vd);
1472
1473 for (c = 0; c < vd->vdev_children; c++) {
1474 cvd = vd->vdev_child[c];
1475
1476 if (cvd->vdev_open_error != 0) {

--- 120 unchanged lines hidden (view full) ---

1597 for (c = rm->rm_cols - 1; c >= 0; c--) {
1598 rc = &rm->rm_col[c];
1599 cvd = vd->vdev_child[rc->rc_devidx];
1600 if (!vdev_readable(cvd)) {
1601 if (c >= rm->rm_firstdatacol)
1602 rm->rm_missingdata++;
1603 else
1604 rm->rm_missingparity++;
1605 rc->rc_error = ENXIO;
1605 rc->rc_error = SET_ERROR(ENXIO);
1606 rc->rc_tried = 1; /* don't even try */
1607 rc->rc_skipped = 1;
1608 continue;
1609 }
1610 if (vdev_dtl_contains(cvd, DTL_MISSING, zio->io_txg, 1)) {
1611 if (c >= rm->rm_firstdatacol)
1612 rm->rm_missingdata++;
1613 else
1614 rm->rm_missingparity++;
1606 rc->rc_tried = 1; /* don't even try */
1607 rc->rc_skipped = 1;
1608 continue;
1609 }
1610 if (vdev_dtl_contains(cvd, DTL_MISSING, zio->io_txg, 1)) {
1611 if (c >= rm->rm_firstdatacol)
1612 rm->rm_missingdata++;
1613 else
1614 rm->rm_missingparity++;
1615 rc->rc_error = ESTALE;
1615 rc->rc_error = SET_ERROR(ESTALE);
1616 rc->rc_skipped = 1;
1617 continue;
1618 }
1619 if (c >= rm->rm_firstdatacol || rm->rm_missingdata > 0 ||
1620 (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER))) {
1621 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1622 rc->rc_offset, rc->rc_data, rc->rc_size,
1623 zio->io_type, zio->io_priority, 0,

--- 71 unchanged lines hidden (view full) ---

1695 vdev_raidz_generate_parity(rm);
1696
1697 for (c = 0; c < rm->rm_firstdatacol; c++) {
1698 rc = &rm->rm_col[c];
1699 if (!rc->rc_tried || rc->rc_error != 0)
1700 continue;
1701 if (bcmp(orig[c], rc->rc_data, rc->rc_size) != 0) {
1702 raidz_checksum_error(zio, rc, orig[c]);
1616 rc->rc_skipped = 1;
1617 continue;
1618 }
1619 if (c >= rm->rm_firstdatacol || rm->rm_missingdata > 0 ||
1620 (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER))) {
1621 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1622 rc->rc_offset, rc->rc_data, rc->rc_size,
1623 zio->io_type, zio->io_priority, 0,

--- 71 unchanged lines hidden (view full) ---

1695 vdev_raidz_generate_parity(rm);
1696
1697 for (c = 0; c < rm->rm_firstdatacol; c++) {
1698 rc = &rm->rm_col[c];
1699 if (!rc->rc_tried || rc->rc_error != 0)
1700 continue;
1701 if (bcmp(orig[c], rc->rc_data, rc->rc_size) != 0) {
1702 raidz_checksum_error(zio, rc, orig[c]);
1703 rc->rc_error = ECKSUM;
1703 rc->rc_error = SET_ERROR(ECKSUM);
1704 ret++;
1705 }
1706 zio_buf_free(orig[c], rc->rc_size);
1707 }
1708
1709 return (ret);
1710}
1711

--- 107 unchanged lines hidden (view full) ---

1819
1820 for (i = 0; i < n; i++) {
1821 c = tgts[i];
1822 rc = &rm->rm_col[c];
1823 ASSERT(rc->rc_error == 0);
1824 if (rc->rc_tried)
1825 raidz_checksum_error(zio, rc,
1826 orig[i]);
1704 ret++;
1705 }
1706 zio_buf_free(orig[c], rc->rc_size);
1707 }
1708
1709 return (ret);
1710}
1711

--- 107 unchanged lines hidden (view full) ---

1819
1820 for (i = 0; i < n; i++) {
1821 c = tgts[i];
1822 rc = &rm->rm_col[c];
1823 ASSERT(rc->rc_error == 0);
1824 if (rc->rc_tried)
1825 raidz_checksum_error(zio, rc,
1826 orig[i]);
1827 rc->rc_error = ECKSUM;
1827 rc->rc_error = SET_ERROR(ECKSUM);
1828 }
1829
1830 ret = code;
1831 goto done;
1832 }
1833
1834 /*
1835 * Restore the original data.

--- 261 unchanged lines hidden (view full) ---

2097 * vdev_raidz_combrec() failed
2098 *
2099 * In either case, there is enough bad data to prevent
2100 * reconstruction.
2101 *
2102 * Start checksum ereports for all children which haven't
2103 * failed, and the IO wasn't speculative.
2104 */
1828 }
1829
1830 ret = code;
1831 goto done;
1832 }
1833
1834 /*
1835 * Restore the original data.

--- 261 unchanged lines hidden (view full) ---

2097 * vdev_raidz_combrec() failed
2098 *
2099 * In either case, there is enough bad data to prevent
2100 * reconstruction.
2101 *
2102 * Start checksum ereports for all children which haven't
2103 * failed, and the IO wasn't speculative.
2104 */
2105 zio->io_error = ECKSUM;
2105 zio->io_error = SET_ERROR(ECKSUM);
2106
2107 if (!(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
2108 for (c = 0; c < rm->rm_cols; c++) {
2109 rc = &rm->rm_col[c];
2110 if (rc->rc_error == 0) {
2111 zio_bad_cksum_t zbc;
2112 zbc.zbc_has_cksum = 0;
2113 zbc.zbc_injected =

--- 60 unchanged lines hidden ---
2106
2107 if (!(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
2108 for (c = 0; c < rm->rm_cols; c++) {
2109 rc = &rm->rm_col[c];
2110 if (rc->rc_error == 0) {
2111 zio_bad_cksum_t zbc;
2112 zbc.zbc_has_cksum = 0;
2113 zbc.zbc_injected =

--- 60 unchanged lines hidden ---