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
cb771fe8
Commit
cb771fe8
authored
Sep 01, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: improve error message on too few devices for ec
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
c9cabfb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
fs/bcachefs/ec.c
fs/bcachefs/ec.c
+16
-3
No files found.
fs/bcachefs/ec.c
View file @
cb771fe8
...
...
@@ -1728,10 +1728,12 @@ ec_new_stripe_head_alloc(struct bch_fs *c, unsigned disk_label,
rcu_read_lock
();
h
->
devs
=
target_rw_devs
(
c
,
BCH_DATA_user
,
disk_label
?
group_to_target
(
disk_label
-
1
)
:
0
);
unsigned
nr_devs
=
dev_mask_nr
(
&
h
->
devs
);
for_each_member_device_rcu
(
c
,
ca
,
&
h
->
devs
)
if
(
!
ca
->
mi
.
durability
)
__clear_bit
(
ca
->
dev_idx
,
h
->
devs
.
d
);
unsigned
nr_devs_with_durability
=
dev_mask_nr
(
&
h
->
devs
);
h
->
blocksize
=
pick_blocksize
(
c
,
&
h
->
devs
);
...
...
@@ -1745,9 +1747,20 @@ ec_new_stripe_head_alloc(struct bch_fs *c, unsigned disk_label,
* If we only have redundancy + 1 devices, we're better off with just
* replication:
*/
if
(
h
->
nr_active_devs
<
h
->
redundancy
+
2
)
bch_err
(
c
,
"insufficient devices available to create stripe (have %u, need %u) - mismatched bucket sizes?"
,
h
->
nr_active_devs
,
h
->
redundancy
+
2
);
if
(
h
->
nr_active_devs
<
h
->
redundancy
+
2
)
{
const
char
*
err
;
if
(
nr_devs
<
h
->
redundancy
+
2
)
err
=
NULL
;
else
if
(
nr_devs_with_durability
<
h
->
redundancy
+
2
)
err
=
"cannot use durability=0 devices"
;
else
err
=
"mismatched bucket sizes"
;
if
(
err
)
bch_err
(
c
,
"insufficient devices available to create stripe (have %u, need %u): %s"
,
h
->
nr_active_devs
,
h
->
redundancy
+
2
,
err
);
}
list_add
(
&
h
->
list
,
&
c
->
ec_stripe_head_list
);
return
h
;
...
...
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