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
87cb0239
Commit
87cb0239
authored
Apr 11, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: btree node scan: handle encrypted nodes
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
031ad9e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
fs/bcachefs/btree_node_scan.c
fs/bcachefs/btree_node_scan.c
+10
-0
No files found.
fs/bcachefs/btree_node_scan.c
View file @
87cb0239
...
@@ -133,9 +133,19 @@ static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca,
...
@@ -133,9 +133,19 @@ static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca,
if
(
le64_to_cpu
(
bn
->
magic
)
!=
bset_magic
(
c
))
if
(
le64_to_cpu
(
bn
->
magic
)
!=
bset_magic
(
c
))
return
;
return
;
if
(
bch2_csum_type_is_encryption
(
BSET_CSUM_TYPE
(
&
bn
->
keys
)))
{
struct
nonce
nonce
=
btree_nonce
(
&
bn
->
keys
,
0
);
unsigned
bytes
=
(
void
*
)
&
bn
->
keys
-
(
void
*
)
&
bn
->
flags
;
bch2_encrypt
(
c
,
BSET_CSUM_TYPE
(
&
bn
->
keys
),
nonce
,
&
bn
->
flags
,
bytes
);
}
if
(
btree_id_is_alloc
(
BTREE_NODE_ID
(
bn
)))
if
(
btree_id_is_alloc
(
BTREE_NODE_ID
(
bn
)))
return
;
return
;
if
(
BTREE_NODE_LEVEL
(
bn
)
>=
BTREE_MAX_DEPTH
)
return
;
rcu_read_lock
();
rcu_read_lock
();
struct
found_btree_node
n
=
{
struct
found_btree_node
n
=
{
.
btree_id
=
BTREE_NODE_ID
(
bn
),
.
btree_id
=
BTREE_NODE_ID
(
bn
),
...
...
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