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
fd80d140
Commit
fd80d140
authored
Jul 10, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: fix scheduling while atomic in break_cycle()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
6f692b16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
fs/bcachefs/btree_locking.c
fs/bcachefs/btree_locking.c
+1
-1
fs/bcachefs/util.c
fs/bcachefs/util.c
+22
-3
fs/bcachefs/util.h
fs/bcachefs/util.h
+1
-0
No files found.
fs/bcachefs/btree_locking.c
View file @
fd80d140
...
...
@@ -231,7 +231,7 @@ static noinline int break_cycle(struct lock_graph *g, struct printbuf *cycle)
prt_newline
(
&
buf
);
}
bch2_print_string_as_lines
(
KERN_ERR
,
buf
.
buf
);
bch2_print_string_as_lines
_nonblocking
(
KERN_ERR
,
buf
.
buf
);
printbuf_exit
(
&
buf
);
BUG
();
}
...
...
fs/bcachefs/util.c
View file @
fd80d140
...
...
@@ -252,8 +252,10 @@ void bch2_prt_u64_base2(struct printbuf *out, u64 v)
bch2_prt_u64_base2_nbits
(
out
,
v
,
fls64
(
v
)
?:
1
);
}
void
bch2_print_string_as_lines
(
const
char
*
prefix
,
const
char
*
lines
)
static
void
__bch2_print_string_as_lines
(
const
char
*
prefix
,
const
char
*
lines
,
bool
nonblocking
)
{
bool
locked
=
false
;
const
char
*
p
;
if
(
!
lines
)
{
...
...
@@ -261,7 +263,13 @@ void bch2_print_string_as_lines(const char *prefix, const char *lines)
return
;
}
console_lock
();
if
(
!
nonblocking
)
{
console_lock
();
locked
=
true
;
}
else
{
locked
=
console_trylock
();
}
while
(
1
)
{
p
=
strchrnul
(
lines
,
'\n'
);
printk
(
"%s%.*s
\n
"
,
prefix
,
(
int
)
(
p
-
lines
),
lines
);
...
...
@@ -269,7 +277,18 @@ void bch2_print_string_as_lines(const char *prefix, const char *lines)
break
;
lines
=
p
+
1
;
}
console_unlock
();
if
(
locked
)
console_unlock
();
}
void
bch2_print_string_as_lines
(
const
char
*
prefix
,
const
char
*
lines
)
{
return
__bch2_print_string_as_lines
(
prefix
,
lines
,
false
);
}
void
bch2_print_string_as_lines_nonblocking
(
const
char
*
prefix
,
const
char
*
lines
)
{
return
__bch2_print_string_as_lines
(
prefix
,
lines
,
true
);
}
int
bch2_save_backtrace
(
bch_stacktrace
*
stack
,
struct
task_struct
*
task
,
unsigned
skipnr
,
...
...
fs/bcachefs/util.h
View file @
fd80d140
...
...
@@ -315,6 +315,7 @@ void bch2_prt_u64_base2_nbits(struct printbuf *, u64, unsigned);
void
bch2_prt_u64_base2
(
struct
printbuf
*
,
u64
);
void
bch2_print_string_as_lines
(
const
char
*
prefix
,
const
char
*
lines
);
void
bch2_print_string_as_lines_nonblocking
(
const
char
*
prefix
,
const
char
*
lines
);
typedef
DARRAY
(
unsigned
long
)
bch_stacktrace
;
int
bch2_save_backtrace
(
bch_stacktrace
*
stack
,
struct
task_struct
*
,
unsigned
,
gfp_t
);
...
...
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