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
1fe93f88
Commit
1fe93f88
authored
May 15, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: fix bch2_rbio_narrow_crcs()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
1f7d45be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
fs/bcachefs/io.c
fs/bcachefs/io.c
+7
-12
No files found.
fs/bcachefs/io.c
View file @
1fe93f88
...
...
@@ -1422,7 +1422,7 @@ static void bch2_rbio_narrow_crcs(struct bch_read_bio *rbio)
struct
bkey_i_extent
*
e
;
BKEY_PADDED
(
k
)
new
;
struct
bch_extent_crc_unpacked
new_crc
;
u
nsigned
offset
;
u
64
data_offset
=
rbio
->
pos
.
offset
-
rbio
->
pick
.
crc
.
offset
;
int
ret
;
if
(
rbio
->
pick
.
crc
.
compression_type
)
...
...
@@ -1445,24 +1445,19 @@ static void bch2_rbio_narrow_crcs(struct bch_read_bio *rbio)
e
=
bkey_i_to_extent
(
&
new
.
k
);
if
(
!
bch2_extent_matches_ptr
(
c
,
extent_i_to_s_c
(
e
),
rbio
->
pick
.
ptr
,
rbio
->
pos
.
offset
-
rbio
->
pick
.
crc
.
offset
)
||
rbio
->
pick
.
ptr
,
data_offset
)
||
bversion_cmp
(
e
->
k
.
version
,
rbio
->
version
))
goto
out
;
/* Extent was merged? */
if
(
bkey_start_offset
(
&
e
->
k
)
<
rbio
->
pos
.
offset
||
e
->
k
.
p
.
offset
>
rbio
->
pos
.
offset
+
rbio
->
pick
.
crc
.
uncompressed_size
)
if
(
bkey_start_offset
(
&
e
->
k
)
<
data_
offset
||
e
->
k
.
p
.
offset
>
data_
offset
+
rbio
->
pick
.
crc
.
uncompressed_size
)
goto
out
;
/* The extent might have been partially overwritten since we read it: */
offset
=
rbio
->
pick
.
crc
.
offset
+
(
bkey_start_offset
(
&
e
->
k
)
-
rbio
->
pos
.
offset
);
if
(
bch2_rechecksum_bio
(
c
,
&
rbio
->
bio
,
rbio
->
version
,
rbio
->
pick
.
crc
,
NULL
,
&
new_crc
,
offset
,
e
->
k
.
size
,
rbio
->
pick
.
crc
.
csum_type
))
{
rbio
->
pick
.
crc
,
NULL
,
&
new_crc
,
bkey_start_offset
(
&
e
->
k
)
-
data_
offset
,
e
->
k
.
size
,
rbio
->
pick
.
crc
.
csum_type
))
{
bch_err
(
c
,
"error verifying existing checksum while narrowing checksum (memory corruption?)"
);
goto
out
;
}
...
...
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