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
5394fe94
Commit
5394fe94
authored
Oct 26, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Fix snapshot skiplists
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
e8484348
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
fs/bcachefs/snapshot.c
fs/bcachefs/snapshot.c
+6
-7
No files found.
fs/bcachefs/snapshot.c
View file @
5394fe94
...
@@ -255,8 +255,7 @@ int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k,
...
@@ -255,8 +255,7 @@ int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k,
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
s
.
v
->
skip
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
s
.
v
->
skip
);
i
++
)
{
id
=
le32_to_cpu
(
s
.
v
->
skip
[
i
]);
id
=
le32_to_cpu
(
s
.
v
->
skip
[
i
]);
if
((
id
&&
!
s
.
v
->
parent
)
||
if
(
id
&&
id
<
le32_to_cpu
(
s
.
v
->
parent
))
{
(
id
&&
id
<=
k
.
k
->
p
.
offset
))
{
prt_printf
(
err
,
"bad skiplist node %u"
,
id
);
prt_printf
(
err
,
"bad skiplist node %u"
,
id
);
return
-
BCH_ERR_invalid_bkey
;
return
-
BCH_ERR_invalid_bkey
;
}
}
...
@@ -1348,12 +1347,12 @@ static int bch2_fix_child_of_deleted_snapshot(struct btree_trans *trans,
...
@@ -1348,12 +1347,12 @@ static int bch2_fix_child_of_deleted_snapshot(struct btree_trans *trans,
u32
id
=
le32_to_cpu
(
s
->
v
.
skip
[
j
]);
u32
id
=
le32_to_cpu
(
s
->
v
.
skip
[
j
]);
if
(
snapshot_list_has_id
(
deleted
,
id
))
{
if
(
snapshot_list_has_id
(
deleted
,
id
))
{
id
=
depth
>
1
id
=
bch2_snapshot_nth_parent_skip
(
c
,
?
bch2_snapshot_nth_parent_skip
(
c
,
parent
,
parent
,
get_random_u32_below
(
depth
-
1
),
depth
>
1
deleted
)
?
get_random_u32_below
(
depth
-
1
)
:
parent
;
:
0
,
deleted
);
s
->
v
.
skip
[
j
]
=
cpu_to_le32
(
id
);
s
->
v
.
skip
[
j
]
=
cpu_to_le32
(
id
);
}
}
}
}
...
...
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