| 659 | } |
| 660 | |
| 661 | static void |
| 662 | vdev_draid_cksum_finish(zio_cksum_report_t *zcr, const abd_t *good_data) |
| 663 | { |
| 664 | raidz_map_t *rm = zcr->zcr_cbdata; |
| 665 | const size_t c = zcr->zcr_cbinfo; |
| 666 | uint64_t skip_size = zcr->zcr_sector; |
| 667 | uint64_t parity_size; |
| 668 | size_t x, offset, size; |
| 669 | |
| 670 | if (good_data == NULL) { |
| 671 | zfs_ereport_finish_checksum(zcr, NULL, NULL, B_FALSE); |
| 672 | return; |
| 673 | } |
| 674 | |
| 675 | /* |
| 676 | * Detailed cksum reporting is currently only supported for single |
| 677 | * row draid mappings, this covers the vast majority of zios. Only |
| 678 | * a dRAID zio which spans groups will have multiple rows. |
| 679 | */ |
| 680 | if (rm->rm_nrows != 1) { |
| 681 | zfs_ereport_finish_checksum(zcr, NULL, NULL, B_FALSE); |
| 682 | return; |
| 683 | } |
| 684 | |
| 685 | raidz_row_t *rr = rm->rm_row[0]; |
| 686 | const abd_t *good = NULL; |
| 687 | const abd_t *bad = rr->rr_col[c].rc_abd; |
| 688 | |
| 689 | if (c < rr->rr_firstdatacol) { |
| 690 | /* |
| 691 | * The first time through, calculate the parity blocks for |
| 692 | * the good data (this relies on the fact that the good |
| 693 | * data never changes for a given logical zio) |
| 694 | */ |
| 695 | if (rr->rr_col[0].rc_gdata == NULL) { |
| 696 | abd_t *bad_parity[VDEV_DRAID_MAXPARITY]; |
| 697 | |
| 698 | /* |
| 699 | * Set up the rr_col[]s to generate the parity for |
| 700 | * good_data, first saving the parity bufs and |
| 701 | * replacing them with buffers to hold the result. |
| 702 | */ |
| 703 | for (x = 0; x < rr->rr_firstdatacol; x++) { |
| 704 | bad_parity[x] = rr->rr_col[x].rc_abd; |
| 705 | rr->rr_col[x].rc_abd = rr->rr_col[x].rc_gdata = |
| 706 | abd_alloc_sametype(rr->rr_col[x].rc_abd, |
| 707 | rr->rr_col[x].rc_size); |
| 708 | } |
| 709 | |
| 710 | /* |
| 711 | * Fill in the data columns from good_data being |
| 712 | * careful to pad short columns and empty columns |
| 713 | * with a skip sector. |
| 714 | */ |
| 715 | uint64_t good_size = abd_get_size((abd_t *)good_data); |
| 716 | |
| 717 | offset = 0; |
| 718 | for (; x < rr->rr_cols; x++) { |
nothing calls this directly
no test coverage detected