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
3d4998c2
Commit
3d4998c2
authored
Feb 05, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: factor out check_inode_backpointer()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
11def188
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
fs/bcachefs/fsck.c
fs/bcachefs/fsck.c
+29
-9
No files found.
fs/bcachefs/fsck.c
View file @
3d4998c2
...
...
@@ -1461,16 +1461,15 @@ static int check_subdir_count(struct btree_trans *trans, struct inode_walker *w)
return
ret
?:
trans_was_restarted
(
trans
,
restart_count
);
}
static
int
check_
dirent_target
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
iter
,
struct
bkey_s_c_dirent
d
,
struct
bch_inode_unpacked
*
target
,
u32
target_snapshot
)
static
int
check_
inode_backpointer
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
iter
,
struct
bkey_s_c_dirent
d
,
struct
bch_inode_unpacked
*
target
,
u32
target_snapshot
)
{
struct
bch_fs
*
c
=
trans
->
c
;
struct
bkey_i_dirent
*
n
;
struct
printbuf
buf
=
PRINTBUF
;
struct
btree_iter
bp_iter
=
{
NULL
};
struct
printbuf
buf
=
PRINTBUF
;
int
ret
=
0
;
if
(
!
target
->
bi_dir
&&
...
...
@@ -1541,6 +1540,29 @@ static int check_dirent_target(struct btree_trans *trans,
goto
err
;
}
}
out:
err:
fsck_err:
bch2_trans_iter_exit
(
trans
,
&
bp_iter
);
printbuf_exit
(
&
buf
);
bch_err_fn
(
c
,
ret
);
return
ret
;
}
static
int
check_dirent_target
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
iter
,
struct
bkey_s_c_dirent
d
,
struct
bch_inode_unpacked
*
target
,
u32
target_snapshot
)
{
struct
bch_fs
*
c
=
trans
->
c
;
struct
bkey_i_dirent
*
n
;
struct
printbuf
buf
=
PRINTBUF
;
int
ret
=
0
;
ret
=
check_inode_backpointer
(
trans
,
iter
,
d
,
target
,
target_snapshot
);
if
(
ret
)
goto
err
;
if
(
fsck_err_on
(
d
.
v
->
d_type
!=
inode_d_type
(
target
),
c
,
dirent_d_type_wrong
,
...
...
@@ -1584,10 +1606,8 @@ static int check_dirent_target(struct btree_trans *trans,
d
=
dirent_i_to_s_c
(
n
);
}
out:
err:
fsck_err:
bch2_trans_iter_exit
(
trans
,
&
bp_iter
);
printbuf_exit
(
&
buf
);
bch_err_fn
(
c
,
ret
);
return
ret
;
...
...
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