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
86a225c4
Commit
86a225c4
authored
Feb 20, 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 on startup
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
3c5fa33a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_background.c
+1
-3
fs/bcachefs/journal_io.c
fs/bcachefs/journal_io.c
+9
-0
No files found.
fs/bcachefs/alloc_background.c
View file @
86a225c4
...
@@ -1678,7 +1678,6 @@ int bch2_fs_allocator_start(struct bch_fs *c)
...
@@ -1678,7 +1678,6 @@ int bch2_fs_allocator_start(struct bch_fs *c)
{
{
struct
bch_dev
*
ca
;
struct
bch_dev
*
ca
;
unsigned
i
;
unsigned
i
;
bool
wrote
;
int
ret
;
int
ret
;
down_read
(
&
c
->
gc_lock
);
down_read
(
&
c
->
gc_lock
);
...
@@ -1697,8 +1696,7 @@ int bch2_fs_allocator_start(struct bch_fs *c)
...
@@ -1697,8 +1696,7 @@ int bch2_fs_allocator_start(struct bch_fs *c)
}
}
set_bit
(
BCH_FS_ALLOCATOR_RUNNING
,
&
c
->
flags
);
set_bit
(
BCH_FS_ALLOCATOR_RUNNING
,
&
c
->
flags
);
return
0
;
return
bch2_alloc_write
(
c
,
false
,
&
wrote
);
}
}
void
bch2_fs_allocator_background_init
(
struct
bch_fs
*
c
)
void
bch2_fs_allocator_background_init
(
struct
bch_fs
*
c
)
...
...
fs/bcachefs/journal_io.c
View file @
86a225c4
...
@@ -888,9 +888,18 @@ int bch2_journal_replay(struct bch_fs *c, struct list_head *list)
...
@@ -888,9 +888,18 @@ int bch2_journal_replay(struct bch_fs *c, struct list_head *list)
static
unsigned
journal_dev_buckets_available
(
struct
journal
*
j
,
static
unsigned
journal_dev_buckets_available
(
struct
journal
*
j
,
struct
journal_device
*
ja
)
struct
journal_device
*
ja
)
{
{
struct
bch_fs
*
c
=
container_of
(
j
,
struct
bch_fs
,
journal
);
unsigned
next
=
(
ja
->
cur_idx
+
1
)
%
ja
->
nr
;
unsigned
next
=
(
ja
->
cur_idx
+
1
)
%
ja
->
nr
;
unsigned
available
=
(
ja
->
last_idx
+
ja
->
nr
-
next
)
%
ja
->
nr
;
unsigned
available
=
(
ja
->
last_idx
+
ja
->
nr
-
next
)
%
ja
->
nr
;
/*
* Allocator startup needs some journal space before we can do journal
* replay:
*/
if
(
available
&&
test_bit
(
BCH_FS_ALLOCATOR_STARTED
,
&
c
->
flags
))
available
--
;
/*
/*
* Don't use the last bucket unless writing the new last_seq
* Don't use the last bucket unless writing the new last_seq
* will make another bucket available:
* will make another bucket available:
...
...
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