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
52df04f0
Commit
52df04f0
authored
Sep 04, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: More BCH_SB_MEMBER_INVALID support
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
df88febc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+8
-7
fs/bcachefs/ec.h
fs/bcachefs/ec.h
+3
-1
fs/bcachefs/extents.c
fs/bcachefs/extents.c
+5
-0
fs/bcachefs/replicas.c
fs/bcachefs/replicas.c
+1
-1
No files found.
fs/bcachefs/buckets.c
View file @
52df04f0
...
@@ -100,12 +100,13 @@ static int bch2_check_fix_ptr(struct btree_trans *trans,
...
@@ -100,12 +100,13 @@ static int bch2_check_fix_ptr(struct btree_trans *trans,
struct
bch_dev
*
ca
=
bch2_dev_tryget
(
c
,
p
.
ptr
.
dev
);
struct
bch_dev
*
ca
=
bch2_dev_tryget
(
c
,
p
.
ptr
.
dev
);
if
(
!
ca
)
{
if
(
!
ca
)
{
if
(
fsck_err
(
trans
,
ptr_to_invalid_device
,
if
(
fsck_err_on
(
p
.
ptr
.
dev
!=
BCH_SB_MEMBER_INVALID
,
"pointer to missing device %u
\n
"
trans
,
ptr_to_invalid_device
,
"while marking %s"
,
"pointer to missing device %u
\n
"
p
.
ptr
.
dev
,
"while marking %s"
,
(
printbuf_reset
(
&
buf
),
p
.
ptr
.
dev
,
bch2_bkey_val_to_text
(
&
buf
,
c
,
k
),
buf
.
buf
)))
(
printbuf_reset
(
&
buf
),
bch2_bkey_val_to_text
(
&
buf
,
c
,
k
),
buf
.
buf
)))
*
do_update
=
true
;
*
do_update
=
true
;
return
0
;
return
0
;
}
}
...
@@ -562,7 +563,7 @@ static int bch2_trigger_pointer(struct btree_trans *trans,
...
@@ -562,7 +563,7 @@ static int bch2_trigger_pointer(struct btree_trans *trans,
struct
bch_fs
*
c
=
trans
->
c
;
struct
bch_fs
*
c
=
trans
->
c
;
struct
bch_dev
*
ca
=
bch2_dev_tryget
(
c
,
p
.
ptr
.
dev
);
struct
bch_dev
*
ca
=
bch2_dev_tryget
(
c
,
p
.
ptr
.
dev
);
if
(
unlikely
(
!
ca
))
{
if
(
unlikely
(
!
ca
))
{
if
(
insert
)
if
(
insert
&&
p
.
ptr
.
dev
!=
BCH_SB_MEMBER_INVALID
)
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
err
;
goto
err
;
}
}
...
...
fs/bcachefs/ec.h
View file @
52df04f0
...
@@ -97,7 +97,9 @@ static inline bool __bch2_ptr_matches_stripe(const struct bch_extent_ptr *stripe
...
@@ -97,7 +97,9 @@ static inline bool __bch2_ptr_matches_stripe(const struct bch_extent_ptr *stripe
const
struct
bch_extent_ptr
*
data_ptr
,
const
struct
bch_extent_ptr
*
data_ptr
,
unsigned
sectors
)
unsigned
sectors
)
{
{
return
data_ptr
->
dev
==
stripe_ptr
->
dev
&&
return
(
data_ptr
->
dev
==
stripe_ptr
->
dev
||
data_ptr
->
dev
==
BCH_SB_MEMBER_INVALID
||
stripe_ptr
->
dev
==
BCH_SB_MEMBER_INVALID
)
&&
data_ptr
->
gen
==
stripe_ptr
->
gen
&&
data_ptr
->
gen
==
stripe_ptr
->
gen
&&
data_ptr
->
offset
>=
stripe_ptr
->
offset
&&
data_ptr
->
offset
>=
stripe_ptr
->
offset
&&
data_ptr
->
offset
<
stripe_ptr
->
offset
+
sectors
;
data_ptr
->
offset
<
stripe_ptr
->
offset
+
sectors
;
...
...
fs/bcachefs/extents.c
View file @
52df04f0
...
@@ -787,6 +787,11 @@ void bch2_bkey_drop_ptr_noerror(struct bkey_s k, struct bch_extent_ptr *ptr)
...
@@ -787,6 +787,11 @@ void bch2_bkey_drop_ptr_noerror(struct bkey_s k, struct bch_extent_ptr *ptr)
union
bch_extent_entry
*
entry
=
to_entry
(
ptr
),
*
next
;
union
bch_extent_entry
*
entry
=
to_entry
(
ptr
),
*
next
;
bool
drop_crc
=
true
;
bool
drop_crc
=
true
;
if
(
k
.
k
->
type
==
KEY_TYPE_stripe
)
{
ptr
->
dev
=
BCH_SB_MEMBER_INVALID
;
return
;
}
EBUG_ON
(
ptr
<
&
ptrs
.
start
->
ptr
||
EBUG_ON
(
ptr
<
&
ptrs
.
start
->
ptr
||
ptr
>=
&
ptrs
.
end
->
ptr
);
ptr
>=
&
ptrs
.
end
->
ptr
);
EBUG_ON
(
ptr
->
type
!=
1
<<
BCH_EXTENT_ENTRY_ptr
);
EBUG_ON
(
ptr
->
type
!=
1
<<
BCH_EXTENT_ENTRY_ptr
);
...
...
fs/bcachefs/replicas.c
View file @
52df04f0
...
@@ -796,7 +796,7 @@ bool bch2_have_enough_devs(struct bch_fs *c, struct bch_devs_mask devs,
...
@@ -796,7 +796,7 @@ bool bch2_have_enough_devs(struct bch_fs *c, struct bch_devs_mask devs,
nr_online
+=
test_bit
(
e
->
devs
[
i
],
devs
.
d
);
nr_online
+=
test_bit
(
e
->
devs
[
i
],
devs
.
d
);
struct
bch_dev
*
ca
=
bch2_dev_rcu
(
c
,
e
->
devs
[
i
]);
struct
bch_dev
*
ca
=
bch2_dev_rcu
(
c
,
e
->
devs
[
i
]);
nr_failed
+=
ca
&&
ca
->
mi
.
state
==
BCH_MEMBER_STATE_failed
;
nr_failed
+=
!
ca
||
ca
->
mi
.
state
==
BCH_MEMBER_STATE_failed
;
}
}
rcu_read_unlock
();
rcu_read_unlock
();
...
...
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