Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e4424fee
Commit
e4424fee
authored
Oct 16, 2009
by
NeilBrown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md: fix problems with RAID6 calculations for DDF.
Signed-off-by:
NeilBrown
<
neilb@suse.de
>
parent
417b8d4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
drivers/md/raid5.c
drivers/md/raid5.c
+13
-7
drivers/md/raid5.h
drivers/md/raid5.h
+1
-1
No files found.
drivers/md/raid5.c
View file @
e4424fee
...
@@ -158,11 +158,14 @@ static int raid6_idx_to_slot(int idx, struct stripe_head *sh,
...
@@ -158,11 +158,14 @@ static int raid6_idx_to_slot(int idx, struct stripe_head *sh,
{
{
int
slot
;
int
slot
;
if
(
sh
->
ddf_layout
)
slot
=
(
*
count
)
++
;
if
(
idx
==
sh
->
pd_idx
)
if
(
idx
==
sh
->
pd_idx
)
return
syndrome_disks
;
return
syndrome_disks
;
if
(
idx
==
sh
->
qd_idx
)
if
(
idx
==
sh
->
qd_idx
)
return
syndrome_disks
+
1
;
return
syndrome_disks
+
1
;
slot
=
(
*
count
)
++
;
if
(
!
sh
->
ddf_layout
)
slot
=
(
*
count
)
++
;
return
slot
;
return
slot
;
}
}
...
@@ -727,9 +730,8 @@ static int set_syndrome_sources(struct page **srcs, struct stripe_head *sh)
...
@@ -727,9 +730,8 @@ static int set_syndrome_sources(struct page **srcs, struct stripe_head *sh)
srcs
[
slot
]
=
sh
->
dev
[
i
].
page
;
srcs
[
slot
]
=
sh
->
dev
[
i
].
page
;
i
=
raid6_next_disk
(
i
,
disks
);
i
=
raid6_next_disk
(
i
,
disks
);
}
while
(
i
!=
d0_idx
);
}
while
(
i
!=
d0_idx
);
BUG_ON
(
count
!=
syndrome_disks
);
return
count
;
return
syndrome_disks
;
}
}
static
struct
dma_async_tx_descriptor
*
static
struct
dma_async_tx_descriptor
*
...
@@ -828,7 +830,6 @@ ops_run_compute6_2(struct stripe_head *sh, struct raid5_percpu *percpu)
...
@@ -828,7 +830,6 @@ ops_run_compute6_2(struct stripe_head *sh, struct raid5_percpu *percpu)
failb
=
slot
;
failb
=
slot
;
i
=
raid6_next_disk
(
i
,
disks
);
i
=
raid6_next_disk
(
i
,
disks
);
}
while
(
i
!=
d0_idx
);
}
while
(
i
!=
d0_idx
);
BUG_ON
(
count
!=
syndrome_disks
);
BUG_ON
(
faila
==
failb
);
BUG_ON
(
faila
==
failb
);
if
(
failb
<
faila
)
if
(
failb
<
faila
)
...
@@ -845,7 +846,7 @@ ops_run_compute6_2(struct stripe_head *sh, struct raid5_percpu *percpu)
...
@@ -845,7 +846,7 @@ ops_run_compute6_2(struct stripe_head *sh, struct raid5_percpu *percpu)
init_async_submit
(
&
submit
,
ASYNC_TX_FENCE
,
NULL
,
init_async_submit
(
&
submit
,
ASYNC_TX_FENCE
,
NULL
,
ops_complete_compute
,
sh
,
ops_complete_compute
,
sh
,
to_addr_conv
(
sh
,
percpu
));
to_addr_conv
(
sh
,
percpu
));
return
async_gen_syndrome
(
blocks
,
0
,
count
+
2
,
return
async_gen_syndrome
(
blocks
,
0
,
syndrome_disks
+
2
,
STRIPE_SIZE
,
&
submit
);
STRIPE_SIZE
,
&
submit
);
}
else
{
}
else
{
struct
page
*
dest
;
struct
page
*
dest
;
...
@@ -1935,10 +1936,15 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i, int previous)
...
@@ -1935,10 +1936,15 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i, int previous)
case
ALGORITHM_PARITY_N
:
case
ALGORITHM_PARITY_N
:
break
;
break
;
case
ALGORITHM_ROTATING_N_CONTINUE
:
case
ALGORITHM_ROTATING_N_CONTINUE
:
/* Like left_symmetric, but P is before Q */
if
(
sh
->
pd_idx
==
0
)
if
(
sh
->
pd_idx
==
0
)
i
--
;
/* P D D D Q */
i
--
;
/* P D D D Q */
else
if
(
i
>
sh
->
pd_idx
)
else
{
i
-=
2
;
/* D D Q P D */
/* D D Q P D */
if
(
i
<
sh
->
pd_idx
)
i
+=
raid_disks
;
i
-=
(
sh
->
pd_idx
+
1
);
}
break
;
break
;
case
ALGORITHM_LEFT_ASYMMETRIC_6
:
case
ALGORITHM_LEFT_ASYMMETRIC_6
:
case
ALGORITHM_RIGHT_ASYMMETRIC_6
:
case
ALGORITHM_RIGHT_ASYMMETRIC_6
:
...
...
drivers/md/raid5.h
View file @
e4424fee
...
@@ -488,7 +488,7 @@ static inline int algorithm_valid_raid6(int layout)
...
@@ -488,7 +488,7 @@ static inline int algorithm_valid_raid6(int layout)
{
{
return
(
layout
>=
0
&&
layout
<=
5
)
return
(
layout
>=
0
&&
layout
<=
5
)
||
||
(
layout
==
8
||
layout
=
=
10
)
(
layout
>=
8
&&
layout
<
=
10
)
||
||
(
layout
>=
16
&&
layout
<=
20
);
(
layout
>=
16
&&
layout
<=
20
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment