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
3a5895e3
Commit
3a5895e3
authored
Sep 23, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: check_subvol_path() now prints subvol root inode
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
0b0f0ad9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
fs/bcachefs/fsck.c
fs/bcachefs/fsck.c
+13
-19
fs/bcachefs/sb-errors_format.h
fs/bcachefs/sb-errors_format.h
+1
-1
No files found.
fs/bcachefs/fsck.c
View file @
3a5895e3
...
@@ -2371,22 +2371,6 @@ static bool darray_u32_has(darray_u32 *d, u32 v)
...
@@ -2371,22 +2371,6 @@ static bool darray_u32_has(darray_u32 *d, u32 v)
return
false
;
return
false
;
}
}
/*
* We've checked that inode backpointers point to valid dirents; here, it's
* sufficient to check that the subvolume root has a dirent:
*/
static
int
subvol_has_dirent
(
struct
btree_trans
*
trans
,
struct
bkey_s_c_subvolume
s
)
{
struct
bch_inode_unpacked
inode
;
int
ret
=
bch2_inode_find_by_inum_trans
(
trans
,
(
subvol_inum
)
{
s
.
k
->
p
.
offset
,
le64_to_cpu
(
s
.
v
->
inode
)
},
&
inode
);
if
(
ret
)
return
ret
;
return
inode
.
bi_dir
!=
0
;
}
static
int
check_subvol_path
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
iter
,
struct
bkey_s_c
k
)
static
int
check_subvol_path
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
iter
,
struct
bkey_s_c
k
)
{
{
struct
bch_fs
*
c
=
trans
->
c
;
struct
bch_fs
*
c
=
trans
->
c
;
...
@@ -2405,14 +2389,24 @@ static int check_subvol_path(struct btree_trans *trans, struct btree_iter *iter,
...
@@ -2405,14 +2389,24 @@ static int check_subvol_path(struct btree_trans *trans, struct btree_iter *iter,
struct
bkey_s_c_subvolume
s
=
bkey_s_c_to_subvolume
(
k
);
struct
bkey_s_c_subvolume
s
=
bkey_s_c_to_subvolume
(
k
);
ret
=
subvol_has_dirent
(
trans
,
s
);
struct
bch_inode_unpacked
subvol_root
;
if
(
ret
<
0
)
ret
=
bch2_inode_find_by_inum_trans
(
trans
,
(
subvol_inum
)
{
s
.
k
->
p
.
offset
,
le64_to_cpu
(
s
.
v
->
inode
)
},
&
subvol_root
);
if
(
ret
)
break
;
break
;
if
(
fsck_err_on
(
!
ret
,
/*
* We've checked that inode backpointers point to valid dirents;
* here, it's sufficient to check that the subvolume root has a
* dirent:
*/
if
(
fsck_err_on
(
!
subvol_root
.
bi_dir
,
trans
,
subvol_unreachable
,
trans
,
subvol_unreachable
,
"unreachable subvolume %s"
,
"unreachable subvolume %s"
,
(
bch2_bkey_val_to_text
(
&
buf
,
c
,
s
.
s_c
),
(
bch2_bkey_val_to_text
(
&
buf
,
c
,
s
.
s_c
),
prt_newline
(
&
buf
),
bch2_inode_unpacked_to_text
(
&
buf
,
&
subvol_root
),
buf
.
buf
)))
{
buf
.
buf
)))
{
ret
=
reattach_subvol
(
trans
,
s
);
ret
=
reattach_subvol
(
trans
,
s
);
break
;
break
;
...
...
fs/bcachefs/sb-errors_format.h
View file @
3a5895e3
...
@@ -271,7 +271,7 @@ enum bch_fsck_flags {
...
@@ -271,7 +271,7 @@ enum bch_fsck_flags {
x(subvol_children_not_set, 256, 0) \
x(subvol_children_not_set, 256, 0) \
x(subvol_children_bad, 257, 0) \
x(subvol_children_bad, 257, 0) \
x(subvol_loop, 258, 0) \
x(subvol_loop, 258, 0) \
x(subvol_unreachable, 259,
0)
\
x(subvol_unreachable, 259,
FSCK_AUTOFIX)
\
x(btree_node_bkey_bad_u64s, 260, 0) \
x(btree_node_bkey_bad_u64s, 260, 0) \
x(btree_node_topology_empty_interior_node, 261, 0) \
x(btree_node_topology_empty_interior_node, 261, 0) \
x(btree_ptr_v2_min_key_bad, 262, 0) \
x(btree_ptr_v2_min_key_bad, 262, 0) \
...
...
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