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
9940a791
Commit
9940a791
authored
Aug 28, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Fix error message on bucket overflow
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
06f6c3ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+10
-8
No files found.
fs/bcachefs/buckets.c
View file @
9940a791
...
...
@@ -1415,6 +1415,7 @@ static int bch2_trans_mark_pointer(struct btree_trans *trans,
struct
bkey_s_c
k
;
struct
bkey_alloc_unpacked
u
;
struct
bkey_i_alloc
*
a
;
unsigned
old
;
bool
overflow
;
int
ret
;
...
...
@@ -1443,9 +1444,9 @@ static int bch2_trans_mark_pointer(struct btree_trans *trans,
* Unless we're already updating that key:
*/
if
(
k
.
k
->
type
!=
KEY_TYPE_alloc
)
{
bch_err_ratelimited
(
c
,
"pointer to nonexistent bucket %
u:%z
u"
,
p
.
ptr
.
dev
,
PTR_BUCKET_NR
(
ca
,
&
p
.
ptr
)
);
bch_err_ratelimited
(
c
,
"pointer to nonexistent bucket %
llu:%ll
u"
,
iter
->
pos
.
inode
,
iter
->
pos
.
offset
);
ret
=
-
1
;
goto
out
;
}
...
...
@@ -1458,19 +1459,20 @@ static int bch2_trans_mark_pointer(struct btree_trans *trans,
goto
out
;
}
if
(
!
p
.
ptr
.
cached
)
if
(
!
p
.
ptr
.
cached
)
{
old
=
u
.
dirty_sectors
;
overflow
=
checked_add
(
u
.
dirty_sectors
,
sectors
);
else
}
else
{
old
=
u
.
cached_sectors
;
overflow
=
checked_add
(
u
.
cached_sectors
,
sectors
);
}
u
.
data_type
=
u
.
dirty_sectors
||
u
.
cached_sectors
?
data_type
:
0
;
bch2_fs_inconsistent_on
(
overflow
,
c
,
"bucket sector count overflow: %u + %lli > U16_MAX"
,
!
p
.
ptr
.
cached
?
u
.
dirty_sectors
:
u
.
cached_sectors
,
sectors
);
old
,
sectors
);
a
=
trans_update_key
(
trans
,
iter
,
BKEY_ALLOC_U64s_MAX
);
ret
=
PTR_ERR_OR_ZERO
(
a
);
...
...
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