]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0026-Revert-raidz_map-and-_col-structure-types.patch
add remaining zfs-0.7.6 changes as patches
[zfsonlinux.git] / zfs-patches / 0026-Revert-raidz_map-and-_col-structure-types.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Nathaniel Wesley Filardo
3 <VP331RHQ115POU58JFRLKB7OPA0L18E3@cmx.ietfng.org>
4 Date: Tue, 9 Jan 2018 17:46:52 -0500
5 Subject: [PATCH] Revert raidz_map and _col structure types
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 As part of the refactoring of ab9f4b0b824ab4cc64a4fa382c037f4154de12d6,
11 several uint64_t-s and uint8_t-s were changed to other types. This
12 caused ZoL github issue #6981, an overflow of a size_t on a 32-bit ARM
13 machine. In absense of any strong motivation for the type changes, this
14 simply puts them back, modulo the changes accumulated for ABD.
15
16 Compile-tested on amd64 and run-tested on armhf.
17
18 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
19 Reviewed-by: Gvozden Neskovic <neskovic@gmail.com>
20 Signed-off-by: Nathaniel Wesley Filardo <nwf@cs.jhu.edu>
21 Closes #6981
22 Closes #7023
23 (cherry picked from commit 9fb09f79e573d377b2b041f620eac703be3acc3f)
24 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
25 ---
26 include/sys/vdev_raidz_impl.h | 34 +++++++++++++++++-----------------
27 1 file changed, 17 insertions(+), 17 deletions(-)
28
29 diff --git a/include/sys/vdev_raidz_impl.h b/include/sys/vdev_raidz_impl.h
30 index 4bd15e3d5..0799ed19d 100644
31 --- a/include/sys/vdev_raidz_impl.h
32 +++ b/include/sys/vdev_raidz_impl.h
33 @@ -102,30 +102,30 @@ typedef struct raidz_impl_ops {
34 } raidz_impl_ops_t;
35
36 typedef struct raidz_col {
37 - size_t rc_devidx; /* child device index for I/O */
38 - size_t rc_offset; /* device offset */
39 - size_t rc_size; /* I/O size */
40 + uint64_t rc_devidx; /* child device index for I/O */
41 + uint64_t rc_offset; /* device offset */
42 + uint64_t rc_size; /* I/O size */
43 abd_t *rc_abd; /* I/O data */
44 void *rc_gdata; /* used to store the "good" version */
45 int rc_error; /* I/O error for this device */
46 - unsigned int rc_tried; /* Did we attempt this I/O column? */
47 - unsigned int rc_skipped; /* Did we skip this I/O column? */
48 + uint8_t rc_tried; /* Did we attempt this I/O column? */
49 + uint8_t rc_skipped; /* Did we skip this I/O column? */
50 } raidz_col_t;
51
52 typedef struct raidz_map {
53 - size_t rm_cols; /* Regular column count */
54 - size_t rm_scols; /* Count including skipped columns */
55 - size_t rm_bigcols; /* Number of oversized columns */
56 - size_t rm_asize; /* Actual total I/O size */
57 - size_t rm_missingdata; /* Count of missing data devices */
58 - size_t rm_missingparity; /* Count of missing parity devices */
59 - size_t rm_firstdatacol; /* First data column/parity count */
60 - size_t rm_nskip; /* Skipped sectors for padding */
61 - size_t rm_skipstart; /* Column index of padding start */
62 + uint64_t rm_cols; /* Regular column count */
63 + uint64_t rm_scols; /* Count including skipped columns */
64 + uint64_t rm_bigcols; /* Number of oversized columns */
65 + uint64_t rm_asize; /* Actual total I/O size */
66 + uint64_t rm_missingdata; /* Count of missing data devices */
67 + uint64_t rm_missingparity; /* Count of missing parity devices */
68 + uint64_t rm_firstdatacol; /* First data column/parity count */
69 + uint64_t rm_nskip; /* Skipped sectors for padding */
70 + uint64_t rm_skipstart; /* Column index of padding start */
71 abd_t *rm_abd_copy; /* rm_asize-buffer of copied data */
72 - size_t rm_reports; /* # of referencing checksum reports */
73 - unsigned int rm_freed; /* map no longer has referencing ZIO */
74 - unsigned int rm_ecksuminjected; /* checksum error was injected */
75 + uintptr_t rm_reports; /* # of referencing checksum reports */
76 + uint8_t rm_freed; /* map no longer has referencing ZIO */
77 + uint8_t rm_ecksuminjected; /* checksum error was injected */
78 raidz_impl_ops_t *rm_ops; /* RAIDZ math operations */
79 raidz_col_t rm_col[1]; /* Flexible array of I/O columns */
80 } raidz_map_t;
81 --
82 2.14.2
83