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
c1f59ef6
Commit
c1f59ef6
authored
Feb 11, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: More info on check_bucket_ref() error
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
930c0c4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+10
-6
No files found.
fs/bcachefs/buckets.c
View file @
c1f59ef6
...
...
@@ -663,13 +663,14 @@ int bch2_mark_metadata_bucket(struct bch_fs *c, struct bch_dev *ca,
return
ret
;
}
static
int
check_bucket_ref
(
struct
b
ch_fs
*
c
,
static
int
check_bucket_ref
(
struct
b
tree_trans
*
trans
,
struct
bkey_s_c
k
,
const
struct
bch_extent_ptr
*
ptr
,
s64
sectors
,
enum
bch_data_type
ptr_data_type
,
u8
b_gen
,
u8
bucket_data_type
,
u32
dirty_sectors
,
u32
cached_sectors
)
{
struct
bch_fs
*
c
=
trans
->
c
;
struct
bch_dev
*
ca
=
bch_dev_bkey_exists
(
c
,
ptr
->
dev
);
size_t
bucket_nr
=
PTR_BUCKET_NR
(
ca
,
ptr
);
u16
bucket_sectors
=
!
ptr
->
cached
...
...
@@ -726,7 +727,7 @@ static int check_bucket_ref(struct bch_fs *c,
if
(
b_gen
!=
ptr
->
gen
)
{
ret
=
1
;
goto
err
;
goto
out
;
}
if
(
!
data_type_is_empty
(
bucket_data_type
)
&&
...
...
@@ -756,9 +757,12 @@ static int check_bucket_ref(struct bch_fs *c,
ret
=
-
EIO
;
goto
err
;
}
err
:
out
:
printbuf_exit
(
&
buf
);
return
ret
;
err:
bch2_dump_trans_updates
(
trans
);
goto
out
;
}
static
int
mark_stripe_bucket
(
struct
btree_trans
*
trans
,
...
...
@@ -800,7 +804,7 @@ static int mark_stripe_bucket(struct btree_trans *trans,
bucket_lock
(
g
);
old
=
*
g
;
ret
=
check_bucket_ref
(
c
,
k
,
ptr
,
sectors
,
data_type
,
ret
=
check_bucket_ref
(
trans
,
k
,
ptr
,
sectors
,
data_type
,
g
->
gen
,
g
->
data_type
,
g
->
dirty_sectors
,
g
->
cached_sectors
);
if
(
ret
)
...
...
@@ -832,7 +836,7 @@ static int __mark_pointer(struct btree_trans *trans,
u32
*
dst_sectors
=
!
ptr
->
cached
?
dirty_sectors
:
cached_sectors
;
int
ret
=
check_bucket_ref
(
trans
->
c
,
k
,
ptr
,
sectors
,
ptr_data_type
,
int
ret
=
check_bucket_ref
(
trans
,
k
,
ptr
,
sectors
,
ptr_data_type
,
bucket_gen
,
*
bucket_data_type
,
*
dirty_sectors
,
*
cached_sectors
);
...
...
@@ -1557,7 +1561,7 @@ static int bch2_trans_mark_stripe_bucket(struct btree_trans *trans,
if
(
IS_ERR
(
a
))
return
PTR_ERR
(
a
);
ret
=
check_bucket_ref
(
c
,
s
.
s_c
,
ptr
,
sectors
,
data_type
,
ret
=
check_bucket_ref
(
trans
,
s
.
s_c
,
ptr
,
sectors
,
data_type
,
a
->
v
.
gen
,
a
->
v
.
data_type
,
a
->
v
.
dirty_sectors
,
a
->
v
.
cached_sectors
);
if
(
ret
)
...
...
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