Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
a081ad5
[WIP] raidz expansion, alpha preview 1
ahrens Apr 3, 2018
421b6f1
Merge remote-tracking branch 'upstream/master' into raidz
thorsteneb Apr 3, 2020
107b024
Merge branch 'master' into pullrequest
stuartmaybee Jun 23, 2020
06b7649
merge with upstream
ahrens Jun 24, 2020
266045c
Fix RPM build and 32 bit build problems with current raidz expansion …
stuartmaybee Jul 17, 2020
a1d3e2b
Merge pull request #4 from stuartmaybee/raidz
ahrens Jul 19, 2020
145cf0c
Fix assert in case of incorrect string memory allocation
Jul 20, 2020
dff66b2
Restore accelerated math routines
Jun 16, 2020
36c1310
Restore raidz_test utility
Jun 16, 2020
3b0dc52
Convert raidz_expand_test.sh to appropriate testcase
Jun 16, 2020
43500f6
Add tests to Makefile
ahrens Jul 21, 2020
dfacfe0
disable expensive dbgmsg
ahrens Jul 28, 2020
73bb1b8
no need to verify parity on every read
ahrens Jul 28, 2020
fc43bed
decrease read queue depth to encourage aggregation
ahrens Jul 28, 2020
7678090
Add IO aggregation in case of expanded read
fuporovvStack Jul 30, 2020
52e5e11
remove ./module/os/linux/zfs/abd.c
ahrens Jul 31, 2020
52c2d66
abdstruct
ahrens Jul 31, 2020
c343171
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jul 31, 2020
815f627
Merge branch 'raidz' into raidz-perf
ahrens Jul 31, 2020
bc02aed
inline linear check
ahrens Jul 31, 2020
0964003
copy_from_buf
ahrens Jul 31, 2020
96db389
parity points to aggregate abd
ahrens Aug 1, 2020
46fc6b3
abdstruct 2
ahrens Aug 1, 2020
2467882
add_many_nv
ahrens Aug 1, 2020
115b6ea
abdstruct 3
ahrens Aug 1, 2020
6c23e3a
clean up code in vdev_raidz_map_alloc_expanded
ahrens Aug 26, 2020
fe2ca28
clean up code in vdev_raidz_map_alloc
ahrens Aug 26, 2020
1d6b312
Add raidz expansion test to ztest, fix vdev_raidz_load() bug, cstyle …
stuartmaybee Aug 26, 2020
44c2a6c
Merge branch 'raidz' of https://github.com/ahrens/zfs into raidz
stuartmaybee Aug 26, 2020
34666ff
Add new arg to spa_vdev_attach() call
stuartmaybee Aug 26, 2020
3539ac6
do not allow sync_task_nowait(vdev_raidz_attach_sync) to fail with EN…
ahrens Aug 29, 2020
2f2dd2a
double writes
ahrens Aug 26, 2020
9ef06d2
debug
ahrens Aug 24, 2020
0ccbc9e
wait before passing overlap point
ahrens Aug 29, 2020
a0baa47
cleanup
ahrens Aug 30, 2020
5ed7b2f
Initial version of time dependent geometry
fuporovvStack Aug 10, 2020
8bce658
Move txgs avl tree to vdev_raidz_t
fuporovvStack Aug 13, 2020
77f502e
Use TREE_CMP in the avl comparator
fuporovvStack Aug 13, 2020
cb5e84e
Remove ZPOOL_CONFIG_RAIDZ_LOGICAL_WIDTH
fuporovvStack Aug 13, 2020
1c262b9
Use BP_PHYSICAL_BIRTH together with zio bp
fuporovvStack Aug 13, 2020
8fd758b
Simplify if expression around vdev_raidz_get_width()
fuporovvStack Aug 13, 2020
0a96ce3
Add reflow_node_t comment
fuporovvStack Aug 14, 2020
1a38996
Add raidz expansion test case
fuporovvStack Aug 14, 2020
7b3f5ab
clean up time dependent geometry
ahrens Aug 21, 2020
55abf89
Address comments from Matt on the raidz expand thest changes.
stuartmaybee Aug 31, 2020
f54144c
Merge branch 'raidz' of https://github.com/ahrens/zfs into raidz
stuartmaybee Aug 31, 2020
c3ccf7c
Fix cstyle
stuartmaybee Aug 31, 2020
3551ea5
Original width is one less when in the middle of expansion
ahrens Sep 2, 2020
862f908
Fix reflow txgs tree creation in case if expansion is progress
fuporovvStack Sep 9, 2020
5bb5bed
Restore vdev_raidz_io_verify()
fuporovvStack Sep 9, 2020
43d4d74
Improve raidz expansion test
fuporovvStack Sep 9, 2020
11a742d
Fix issue where attach to raidz (expand) accepts nonsense parity spec.
stuartmaybee Sep 22, 2020
76fe8c9
Fix issue where 2nd raidz expand allowed while 1st expand still in pr…
stuartmaybee Sep 22, 2020
96c3b08
PR comments addressed, use spa_raidz_expand rather than adding a flag
stuartmaybee Sep 29, 2020
8047b91
Merge pull request #12 from stuartmaybee/raidz
ahrens Sep 30, 2020
d957c65
Merge pull request #15 from fuporovvStack/raidz-time-dependent-geomet…
ahrens Nov 3, 2020
4004662
Merge remote-tracking branch 'github-personal/raidz' into raidz-tdg
ahrens Nov 3, 2020
868dc75
cleanup
ahrens Nov 3, 2020
e9fed56
allocate based on new width
ahrens Nov 3, 2020
2fa0fa7
fixes
ahrens Nov 12, 2020
a3239fa
Merge pull request #11 from ahrens/raidz-tdg
ahrens Nov 16, 2020
696129a
Merge commit 'a724db03740133c46b9a577b41a6f7221acd3e1f' into raidz-merge
ahrens Nov 16, 2020
68850aa
Merge pull request #17 from ahrens/raidz-merge
ahrens Nov 17, 2020
9adcbf2
Merge commit 'b2255edcc0099e62ad46a3dd9d64537663c6aee3' into raidz-me…
ahrens Nov 17, 2020
d89fccf
Merge commit 'b2255edcc0099e62ad46a3dd9d64537663c6aee3' into raidz-me…
ahrens Nov 17, 2020
09b5c99
Merge branch 'raidz-merge2' into raidz-perf
ahrens Nov 18, 2020
2acd6a4
Merge pull request #18 from ahrens/raidz-merge2
ahrens Dec 2, 2020
ae16fbb
Merge branch 'raidz' into raidz-perf
ahrens Dec 2, 2020
9bd5dcc
revert max_active
ahrens Dec 2, 2020
dd1672c
revert abdstruct
ahrens Dec 2, 2020
cc3fe2f
Revert "revert abdstruct"
ahrens Dec 2, 2020
c97c937
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jan 14, 2021
d879323
more debug
ahrens Jan 15, 2021
5de9a06
fix merge with draid
ahrens Jan 16, 2021
21692d9
Remove incorrect assert
Dec 22, 2020
4434334
Fix ztest_vdev_attach_detach() return
Dec 21, 2020
edae605
Add ztest_vdev_raidz_attach() function
Jan 19, 2021
e43b633
Run only specified set of ztest functions together with ztest raidz a…
Jan 19, 2021
29fd102
Do not ztest_freeze() in case of raidz expansion test
Jan 18, 2021
8aeeaff
dbgmsg
ahrens Jan 19, 2021
6e34510
error
ahrens Jan 19, 2021
5b3cc3d
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jan 21, 2021
41688ac
Merge branch 'raidz' into raidz-perf
ahrens Jan 21, 2021
80da56e
fixes
ahrens Jan 22, 2021
a93cac3
fix draid
ahrens Jan 22, 2021
25a19d5
code cleanup
ahrens Jan 22, 2021
b9e16b4
fix receive of DRR_WRITE_EMBEDDED
ahrens Jan 22, 2021
9d63705
Merge branch 'raidz' into raidz-perf
ahrens Jan 25, 2021
bf6e9a6
cleanup
ahrens Jan 25, 2021
dad8b4d
Add ZFS_ERR_RAIDZ_EXPANSION error in case of checkpoint creation on p…
Jan 18, 2021
cd3c8e8
tunables
ahrens Jan 28, 2021
a417b63
test
ahrens Jan 29, 2021
06d8c1b
Fix typos and small cleanup
fuporovvStack Jan 29, 2021
85b80aa
fix aggregation of disjoint block
ahrens Jan 29, 2021
01cdced
debug
ahrens Jan 29, 2021
8048f9b
fix aggregate io parity healing
ahrens Jan 29, 2021
8ad9285
smaller spa_min_slop
ahrens Jan 29, 2021
192b0ec
disable debug
ahrens Jan 30, 2021
4ab68c1
Add raidz expansion zfeature
Jan 18, 2021
9310a69
scratch space
ahrens Feb 2, 2021
485cdf2
progress reporting
ahrens Feb 9, 2021
8461fae
color
ahrens Feb 9, 2021
b35284d
cleanup
ahrens Feb 9, 2021
0bd9514
initial reflow big chunk
ahrens Feb 9, 2021
5afd2ae
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Feb 10, 2021
91979eb
Merge remote-tracking branch 'remotes/github-personal/20/head' into r…
ahrens Feb 10, 2021
98d8e6c
fix resilver
ahrens Feb 10, 2021
682fed6
XXX modify test
ahrens Feb 10, 2021
51e8c81
Merge remote-tracking branch 'github-personal/raidz' into raidz-ztest
ahrens Feb 10, 2021
c06bd43
fix resilver part 2
ahrens Feb 11, 2021
ea9930f
Merge branch 'raidz-scratch' into raidz-ztest
ahrens Feb 11, 2021
a1f42d3
testing
ahrens Feb 12, 2021
52b150b
redo opening
ahrens Feb 13, 2021
4d2633f
fixes
ahrens Feb 18, 2021
17c933e
file write debug
ahrens Feb 21, 2021
cab63c2
need to swap shadow cols 0/1 too
ahrens Feb 21, 2021
86767fb
file write debug 2
ahrens Feb 21, 2021
c1b8360
need to swap shadow cols 0/1 too 2
ahrens Feb 21, 2021
b1e5d93
redo aggregation detection
ahrens Feb 22, 2021
3057d31
fix compilation errors
ahrens Feb 23, 2021
67f4212
fix debug compilation error
ahrens Feb 23, 2021
48028eb
Merge remote-tracking branch 'origin/upstreams/master' into raidz-ztest
ahrens Feb 23, 2021
1e931db
fix zpool_get_002_pos
ahrens Feb 24, 2021
cbc96fb
fix rsend_009_pos
ahrens Feb 24, 2021
584e1f6
Force symlink creation for zpool.d compat links
Feb 22, 2021
4bcbf22
Make raidz map allocation functions args lists more compatible
FedorUporovVstack Feb 24, 2021
6321005
cleanup
ahrens Feb 24, 2021
7723a89
fix scrub shadow
ahrens Feb 24, 2021
0f37bac
handle device failure during reflow
ahrens Feb 24, 2021
b99627c
fix overlap
ahrens Feb 25, 2021
0d93357
dbgmsg
ahrens Feb 25, 2021
4d2de34
fix ENOSPC when offline disk
ahrens Feb 26, 2021
26b3856
print paused status
ahrens Feb 26, 2021
e6b4087
wait for reflow
ahrens Feb 26, 2021
53bed82
zpool-wait manpage
ahrens Feb 26, 2021
59779db
Merge pull request #23 from fuporovvStack/map-alloc-funcs-args
ahrens Feb 27, 2021
efa915c
Merge pull request #21 from fuporovvStack/raidz-checkpoint-error
ahrens Feb 27, 2021
6a9d3bd
notify from reassess
ahrens Feb 26, 2021
fea256c
cleanup
ahrens Mar 9, 2021
0d5a7f7
Merge remote-tracking branch 'origin/upstreams/master' into raidz-ztest
ahrens Mar 9, 2021
34bf57c
cleanup
ahrens Mar 9, 2021
7516bb1
cleanup
ahrens Mar 9, 2021
1abd4e8
cleanup
ahrens Mar 9, 2021
645ca26
cleanup
ahrens Mar 9, 2021
f0992f9
tests
ahrens Mar 10, 2021
625320f
add test scripts
ahrens Mar 10, 2021
fbdb7bc
cleanup
ahrens Mar 10, 2021
219c7dd
Clean up RAIDZ/DRAID ereport code
ahrens Mar 10, 2021
c8a94c9
Merge branch 'openzfs/raidz-ereport2' into raidz
ahrens Mar 13, 2021
d9d93fe
skip
ahrens Mar 13, 2021
84074d5
code
ahrens Mar 13, 2021
d2142dd
Revert "Fix sporadic failure of rsend_009_pos"
ahrens Mar 14, 2021
444d914
Revert "refcount_add_nv"
ahrens Mar 14, 2021
c56aebd
cleanup
ahrens Mar 16, 2021
cbc5322
Convert scripts: raidz_expand_doublewrite.sh raidz_expand_resilver.sh…
FedorUporovVstack Mar 12, 2021
0add27c
ztest: Fix spa_vdev_attach() busy error
FedorUporovVstack Mar 15, 2021
1ea4b1b
Add vdev_raidz_reflow_copy_scratch() workarounds
FedorUporovVstack Mar 15, 2021
a539f70
Add raidz scratch object verification to ztest
FedorUporovVstack Mar 15, 2021
424405a
Block vdev_raidz_xlate() usage during raidz expansion
FedorUporovVstack Mar 3, 2021
ee214aa
Fix checkstyle: line > 80 characters for vdev_raidz.c
FedorUporovVstack Apr 13, 2021
e3defd9
Fix ztest children count
FedorUporovVstack Apr 13, 2021
9dfd90a
Remove unused rr_code field
FedorUporovVstack Apr 8, 2021
3be6ec7
Some more codestyle fixes
fuporovvStack Apr 13, 2021
5c123ea
Merge pull request #27 from fuporovvStack/vdev-raidz-codestyle
ahrens Apr 19, 2021
697fbc7
Merge pull request #29 from fuporovvStack/remove-rr-code
ahrens Apr 19, 2021
37aae5f
Merge remote-tracking branch 'github-personal' into raidz
ahrens Apr 21, 2021
fcf477d
Merge remote-tracking branch 'github-openzfs/master' into raidz
ahrens Apr 21, 2021
db4c736
Merge remote-tracking branch 'github-personal/raidz' into raidz
ahrens Apr 21, 2021
80301d7
Merge remote-tracking branch 'github-openzfs/master' into raidz-merge
ahrens Apr 21, 2021
e6b0d1c
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jun 2, 2021
3947502
use bitfield (yikes!)
ahrens Jun 2, 2021
a7836f6
fix merge
ahrens Jun 2, 2021
d83aa0f
Fix the raidz_reflow_complete_sync() assert on reflow offset check
ahrens Jun 2, 2021
21e5b0f
Fix issue with vdev_expand() with metaslabs recreation during raidz e…
ahrens Jun 2, 2021
8225298
Spare or mirror device as raidz child cause assert failure in case of…
ahrens Jun 3, 2021
37cd657
format long lines
ahrens Jun 3, 2021
59acc45
fix expand_001
ahrens Jun 3, 2021
5b15606
manpage
ahrens Jun 3, 2021
4cdcc63
fix
ahrens Jun 3, 2021
2c466c2
vdev_xlate
ahrens Jun 3, 2021
7ff648f
cleanup
ahrens Jun 4, 2021
3d61ee7
Merge remote-tracking branch 'github-personal/raidz' into raidz
ahrens Jun 4, 2021
00c36f3
Merge branch 'raidz' into block-xlate
ahrens Jun 4, 2021
95022a7
Merge pull request #26 from fuporovvStack/block-xlate
ahrens Jun 4, 2021
69613d6
Merge pull request #28 from fuporovvStack/ztest-raidz-children
ahrens Jun 4, 2021
526b3c1
Merge branch 'raidz' into convert-testcases
ahrens Jun 4, 2021
3d7902f
Merge pull request #24 from fuporovvStack/convert-testcases
ahrens Jun 4, 2021
746f90e
Merge pull request #25 from fuporovvStack/convert-testcases-scratch
ahrens Jun 4, 2021
36d75ff
cleanup
ahrens Jun 4, 2021
f81837a
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jun 4, 2021
ce8d671
tunables
ahrens Jun 4, 2021
5f0f687
runfile
ahrens Jun 5, 2021
1c025f1
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jun 5, 2021
1092a8b
fix long lines and formatting
Fmstrat Jun 5, 2021
80aaa70
Merge pull request #30 from Fmstrat/raidz-linting
ahrens Jun 5, 2021
a866e47
fix #11459
ahrens Jun 5, 2021
c708033
my_tgts overflow
ahrens Jun 6, 2021
2d2f6c4
fix zs_do_raidz_scratch_verify
ahrens Jun 8, 2021
58554e3
Merge remote-tracking branch 'origin/upstreams/master' into raidz
ahrens Jun 10, 2021
6c46d81
zpool-features.7
ahrens Jun 10, 2021
2faec69
zfs.4
ahrens Jun 10, 2021
c3f4a9a
cleanup
ahrens Jun 10, 2021
1875530
disable zstd mempool
ahrens Jun 10, 2021
120782e
nits
ahrens Jun 10, 2021
304c454
reduce runtime of raidz_expand_002_pos
ahrens Jun 10, 2021
721913d
fix memory leak
ahrens Jun 10, 2021
7384b93
no need to disable aggregation
ahrens Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmd/raidz_test/raidz_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ run_gen_bench_impl(const char *impl)

if (rto_opts.rto_expand) {
rm_bench = vdev_raidz_map_alloc_expanded(
zio_bench.io_abd,
zio_bench.io_size, zio_bench.io_offset,
&zio_bench,
rto_opts.rto_ashift, ncols+1, ncols,
fn+1, rto_opts.rto_expand_offset);
fn+1, rto_opts.rto_expand_offset,
0, B_FALSE);
} else {
rm_bench = vdev_raidz_map_alloc(&zio_bench,
BENCH_ASHIFT, ncols, fn+1);
Expand Down Expand Up @@ -172,10 +172,10 @@ run_rec_bench_impl(const char *impl)

if (rto_opts.rto_expand) {
rm_bench = vdev_raidz_map_alloc_expanded(
zio_bench.io_abd,
zio_bench.io_size, zio_bench.io_offset,
&zio_bench,
BENCH_ASHIFT, ncols+1, ncols,
PARITY_PQR, rto_opts.rto_expand_offset);
PARITY_PQR,
rto_opts.rto_expand_offset, 0, B_FALSE);
} else {
rm_bench = vdev_raidz_map_alloc(&zio_bench,
BENCH_ASHIFT, ncols, PARITY_PQR);
Expand Down
196 changes: 6 additions & 190 deletions cmd/raidz_test/raidz_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,12 @@ init_raidz_golden_map(raidz_test_opts_t *opts, const int parity)

if (opts->rto_expand) {
opts->rm_golden =
vdev_raidz_map_alloc_expanded(opts->zio_golden->io_abd,
opts->zio_golden->io_size, opts->zio_golden->io_offset,
vdev_raidz_map_alloc_expanded(opts->zio_golden,
opts->rto_ashift, total_ncols+1, total_ncols,
parity, opts->rto_expand_offset);
rm_test = vdev_raidz_map_alloc_expanded(zio_test->io_abd,
zio_test->io_size, zio_test->io_offset,
parity, opts->rto_expand_offset, 0, B_FALSE);
rm_test = vdev_raidz_map_alloc_expanded(zio_test,
opts->rto_ashift, total_ncols+1, total_ncols,
parity, opts->rto_expand_offset);
parity, opts->rto_expand_offset, 0, B_FALSE);
} else {
opts->rm_golden = vdev_raidz_map_alloc(opts->zio_golden,
opts->rto_ashift, total_ncols, parity);
Expand All @@ -367,187 +365,6 @@ init_raidz_golden_map(raidz_test_opts_t *opts, const int parity)
return (err);
}

/*
* If reflow is not in progress, reflow_offset should be UINT64_MAX.
* For each row, if the row is entirely before reflow_offset, it will
* come from the new location. Otherwise this row will come from the
* old location. Therefore, rows that straddle the reflow_offset will
* come from the old location.
*
* NOTE: Until raidz expansion is implemented this function is only
* needed by raidz_test.c to the multi-row raid_map_t functionality.
*/
raidz_map_t *
vdev_raidz_map_alloc_expanded(abd_t *abd, uint64_t size, uint64_t offset,
uint64_t ashift, uint64_t physical_cols, uint64_t logical_cols,
uint64_t nparity, uint64_t reflow_offset)
{
/* The zio's size in units of the vdev's minimum sector size. */
uint64_t s = size >> ashift;
uint64_t q, r, bc, devidx, asize = 0, tot;

/*
* "Quotient": The number of data sectors for this stripe on all but
* the "big column" child vdevs that also contain "remainder" data.
* AKA "full rows"
*/
q = s / (logical_cols - nparity);

/*
* "Remainder": The number of partial stripe data sectors in this I/O.
* This will add a sector to some, but not all, child vdevs.
*/
r = s - q * (logical_cols - nparity);

/* The number of "big columns" - those which contain remainder data. */
bc = (r == 0 ? 0 : r + nparity);

/*
* The total number of data and parity sectors associated with
* this I/O.
*/
tot = s + nparity * (q + (r == 0 ? 0 : 1));

/* How many rows contain data (not skip) */
uint64_t rows = howmany(tot, logical_cols);
int cols = MIN(tot, logical_cols);

raidz_map_t *rm = kmem_zalloc(offsetof(raidz_map_t, rm_row[rows]),
KM_SLEEP);
rm->rm_nrows = rows;

for (uint64_t row = 0; row < rows; row++) {
raidz_row_t *rr = kmem_alloc(offsetof(raidz_row_t,
rr_col[cols]), KM_SLEEP);
rm->rm_row[row] = rr;

/* The starting RAIDZ (parent) vdev sector of the row. */
uint64_t b = (offset >> ashift) + row * logical_cols;

/*
* If we are in the middle of a reflow, and any part of this
* row has not been copied, then use the old location of
* this row.
*/
int row_phys_cols = physical_cols;
if (b + (logical_cols - nparity) > reflow_offset >> ashift)
row_phys_cols--;

/* starting child of this row */
uint64_t child_id = b % row_phys_cols;
/* The starting byte offset on each child vdev. */
uint64_t child_offset = (b / row_phys_cols) << ashift;

/*
* We set cols to the entire width of the block, even
* if this row is shorter. This is needed because parity
* generation (for Q and R) needs to know the entire width,
* because it treats the short row as though it was
* full-width (and the "phantom" sectors were zero-filled).
*
* Another approach to this would be to set cols shorter
* (to just the number of columns that we might do i/o to)
* and have another mechanism to tell the parity generation
* about the "entire width". Reconstruction (at least
* vdev_raidz_reconstruct_general()) would also need to
* know about the "entire width".
*/
rr->rr_cols = cols;
rr->rr_bigcols = bc;
rr->rr_missingdata = 0;
rr->rr_missingparity = 0;
rr->rr_firstdatacol = nparity;
rr->rr_abd_empty = NULL;
rr->rr_nempty = 0;

for (int c = 0; c < rr->rr_cols; c++, child_id++) {
if (child_id >= row_phys_cols) {
child_id -= row_phys_cols;
child_offset += 1ULL << ashift;
}
rr->rr_col[c].rc_devidx = child_id;
rr->rr_col[c].rc_offset = child_offset;
rr->rr_col[c].rc_orig_data = NULL;
rr->rr_col[c].rc_error = 0;
rr->rr_col[c].rc_tried = 0;
rr->rr_col[c].rc_skipped = 0;
rr->rr_col[c].rc_need_orig_restore = B_FALSE;

uint64_t dc = c - rr->rr_firstdatacol;
if (c < rr->rr_firstdatacol) {
rr->rr_col[c].rc_size = 1ULL << ashift;
rr->rr_col[c].rc_abd =
abd_alloc_linear(rr->rr_col[c].rc_size,
B_TRUE);
} else if (row == rows - 1 && bc != 0 && c >= bc) {
/*
* Past the end, this for parity generation.
*/
rr->rr_col[c].rc_size = 0;
rr->rr_col[c].rc_abd = NULL;
} else {
/*
* "data column" (col excluding parity)
* Add an ASCII art diagram here
*/
uint64_t off;

if (c < bc || r == 0) {
off = dc * rows + row;
} else {
off = r * rows +
(dc - r) * (rows - 1) + row;
}
rr->rr_col[c].rc_size = 1ULL << ashift;
rr->rr_col[c].rc_abd = abd_get_offset_struct(
&rr->rr_col[c].rc_abdstruct,
abd, off << ashift, 1 << ashift);
}

asize += rr->rr_col[c].rc_size;
}
/*
* If all data stored spans all columns, there's a danger that
* parity will always be on the same device and, since parity
* isn't read during normal operation, that that device's I/O
* bandwidth won't be used effectively. We therefore switch
* the parity every 1MB.
*
* ...at least that was, ostensibly, the theory. As a practical
* matter unless we juggle the parity between all devices
* evenly, we won't see any benefit. Further, occasional writes
* that aren't a multiple of the LCM of the number of children
* and the minimum stripe width are sufficient to avoid pessimal
* behavior. Unfortunately, this decision created an implicit
* on-disk format requirement that we need to support for all
* eternity, but only for single-parity RAID-Z.
*
* If we intend to skip a sector in the zeroth column for
* padding we must make sure to note this swap. We will never
* intend to skip the first column since at least one data and
* one parity column must appear in each row.
*/
if (rr->rr_firstdatacol == 1 && rr->rr_cols > 1 &&
(offset & (1ULL << 20))) {
ASSERT(rr->rr_cols >= 2);
ASSERT(rr->rr_col[0].rc_size == rr->rr_col[1].rc_size);
devidx = rr->rr_col[0].rc_devidx;
uint64_t o = rr->rr_col[0].rc_offset;
rr->rr_col[0].rc_devidx = rr->rr_col[1].rc_devidx;
rr->rr_col[0].rc_offset = rr->rr_col[1].rc_offset;
rr->rr_col[1].rc_devidx = devidx;
rr->rr_col[1].rc_offset = o;
}

}
ASSERT3U(asize, ==, tot << ashift);

/* init RAIDZ parity ops */
rm->rm_ops = vdev_raidz_math_get_ops();

return (rm);
}

static raidz_map_t *
init_raidz_map(raidz_test_opts_t *opts, zio_t **zio, const int parity)
{
Expand All @@ -567,10 +384,9 @@ init_raidz_map(raidz_test_opts_t *opts, zio_t **zio, const int parity)
init_zio_abd(*zio);

if (opts->rto_expand) {
rm = vdev_raidz_map_alloc_expanded((*zio)->io_abd,
(*zio)->io_size, (*zio)->io_offset,
rm = vdev_raidz_map_alloc_expanded(*zio,
opts->rto_ashift, total_ncols+1, total_ncols,
parity, opts->rto_expand_offset);
parity, opts->rto_expand_offset, 0, B_FALSE);
} else {
rm = vdev_raidz_map_alloc(*zio, opts->rto_ashift,
total_ncols, parity);
Expand Down
3 changes: 0 additions & 3 deletions cmd/raidz_test/raidz_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,4 @@ void init_zio_abd(zio_t *zio);

void run_raidz_benchmark(void);

struct raidz_map *vdev_raidz_map_alloc_expanded(abd_t *, uint64_t, uint64_t,
uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);

#endif /* RAIDZ_TEST_H */
5 changes: 5 additions & 0 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3917,6 +3917,11 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
}
(void) printf("\tcheckpoint_txg = %llu\n",
(u_longlong_t)ub->ub_checkpoint_txg);

(void) printf("\traidz_reflow state=%u off=%llu\n",
(int)RRSS_GET_STATE(ub),
(u_longlong_t)RRSS_GET_OFFSET(ub));

(void) printf("%s", footer ? footer : "");
}

Expand Down
Loading