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
65e7ab8f
Commit
65e7ab8f
authored
Mar 22, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Fix a deadlock
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
11e6f19a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/btree_update_leaf.c
+7
-7
No files found.
fs/bcachefs/btree_update_leaf.c
View file @
65e7ab8f
...
...
@@ -560,6 +560,8 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
trans_for_each_update_iter
(
trans
,
i
)
BUG_ON
(
i
->
iter
->
uptodate
>=
BTREE_ITER_NEED_RELOCK
);
btree_trans_lock_write
(
c
,
trans
);
trans_for_each_update_iter
(
trans
,
i
)
{
if
(
i
->
deferred
||
!
btree_node_type_needs_gc
(
i
->
iter
->
btree_id
))
...
...
@@ -577,12 +579,10 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
}
}
btree_trans_lock_write
(
c
,
trans
);
if
(
race_fault
())
{
ret
=
-
EINTR
;
trans_restart
(
" (race)"
);
goto
out
_unlock
;
goto
out
;
}
/*
...
...
@@ -592,7 +592,7 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
*/
ret
=
btree_trans_check_can_insert
(
trans
,
stopped_at
);
if
(
ret
)
goto
out
_unlock
;
goto
out
;
/*
* Don't get journal reservation until after we know insert will
...
...
@@ -600,7 +600,7 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
*/
ret
=
bch2_trans_journal_res_get
(
trans
,
JOURNAL_RES_GET_NONBLOCK
);
if
(
ret
)
goto
out
_unlock
;
goto
out
;
if
(
!
(
trans
->
flags
&
BTREE_INSERT_JOURNAL_REPLAY
))
{
if
(
journal_seq_verify
(
c
))
...
...
@@ -632,13 +632,13 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
trans_for_each_update
(
trans
,
i
)
do_btree_insert_one
(
trans
,
i
);
out
_unlock
:
out:
BUG_ON
(
ret
&&
(
trans
->
flags
&
BTREE_INSERT_JOURNAL_RESERVED
)
&&
trans
->
journal_res
.
ref
);
btree_trans_unlock_write
(
trans
);
out:
if
(
fs_usage
)
{
bch2_fs_usage_scratch_put
(
c
,
fs_usage
);
percpu_up_read
(
&
c
->
mark_lock
);
...
...
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