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
89b05118
Commit
89b05118
authored
Sep 07, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Flush fsck errors when looping in btree gc
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
5055b509
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_gc.c
+2
-0
fs/bcachefs/error.c
fs/bcachefs/error.c
+5
-4
fs/bcachefs/recovery.c
fs/bcachefs/recovery.c
+2
-0
No files found.
fs/bcachefs/btree_gc.c
View file @
89b05118
...
...
@@ -764,6 +764,8 @@ int bch2_gc(struct bch_fs *c, struct journal_keys *journal_keys,
percpu_down_write
(
&
c
->
mark_lock
);
bch2_gc_free
(
c
);
percpu_up_write
(
&
c
->
mark_lock
);
/* flush fsck errors, reset counters */
bch2_flush_fsck_errs
(
c
);
goto
again
;
}
...
...
fs/bcachefs/error.c
View file @
89b05118
...
...
@@ -4,6 +4,8 @@
#include "io.h"
#include "super.h"
#define FSCK_ERR_RATELIMIT_NR 10
bool
bch2_inconsistent_error
(
struct
bch_fs
*
c
)
{
set_bit
(
BCH_FS_ERROR
,
&
c
->
flags
);
...
...
@@ -97,8 +99,8 @@ enum fsck_err_ret bch2_fsck_err(struct bch_fs *c, unsigned flags,
found:
list_move
(
&
s
->
list
,
&
c
->
fsck_errors
);
s
->
nr
++
;
suppressing
=
s
->
nr
==
10
;
print
=
s
->
nr
<=
10
;
suppressing
=
s
->
nr
==
FSCK_ERR_RATELIMIT_NR
;
print
=
s
->
nr
<=
FSCK_ERR_RATELIMIT_NR
;
buf
=
s
->
buf
;
print:
va_start
(
args
,
fmt
);
...
...
@@ -152,10 +154,9 @@ void bch2_flush_fsck_errs(struct bch_fs *c)
struct
fsck_err_state
*
s
,
*
n
;
mutex_lock
(
&
c
->
fsck_error_lock
);
set_bit
(
BCH_FS_FSCK_DONE
,
&
c
->
flags
);
list_for_each_entry_safe
(
s
,
n
,
&
c
->
fsck_errors
,
list
)
{
if
(
s
->
nr
>
10
)
if
(
s
->
nr
>
FSCK_ERR_RATELIMIT_NR
)
bch_err
(
c
,
"Saw %llu errors like:
\n
%s"
,
s
->
nr
,
s
->
buf
);
list_del
(
&
s
->
list
);
...
...
fs/bcachefs/recovery.c
View file @
89b05118
...
...
@@ -936,7 +936,9 @@ int bch2_fs_recovery(struct bch_fs *c)
ret
=
0
;
err:
fsck_err:
set_bit
(
BCH_FS_FSCK_DONE
,
&
c
->
flags
);
bch2_flush_fsck_errs
(
c
);
journal_keys_free
(
&
journal_keys
);
journal_entries_free
(
&
journal_entries
);
kfree
(
clean
);
...
...
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