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
492bb6de
Commit
492bb6de
authored
Jul 31, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Hold a reference on bios during submit_bio, add some extra bio checks
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
3ce7e67a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
fs/btrfs/volumes.c
fs/btrfs/volumes.c
+9
-1
No files found.
fs/btrfs/volumes.c
View file @
492bb6de
...
...
@@ -180,7 +180,11 @@ int run_scheduled_bios(struct btrfs_device *device)
pending
=
pending
->
bi_next
;
cur
->
bi_next
=
NULL
;
atomic_dec
(
&
device
->
dev_root
->
fs_info
->
nr_async_submits
);
BUG_ON
(
atomic_read
(
&
cur
->
bi_cnt
)
==
0
);
bio_get
(
cur
);
submit_bio
(
cur
->
bi_rw
,
cur
);
bio_put
(
cur
);
num_run
++
;
/*
...
...
@@ -188,10 +192,11 @@ int run_scheduled_bios(struct btrfs_device *device)
* is now congested. Back off and let other work structs
* run instead
*/
if
(
pending
&&
num_run
&&
bdi_write_congested
(
bdi
))
{
if
(
pending
&&
bdi_write_congested
(
bdi
))
{
struct
bio
*
old_head
;
spin_lock
(
&
device
->
io_lock
);
old_head
=
device
->
pending_bios
;
device
->
pending_bios
=
pending
;
if
(
device
->
pending_bio_tail
)
...
...
@@ -2125,7 +2130,9 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
/* don't bother with additional async steps for reads, right now */
if
(
!
(
rw
&
(
1
<<
BIO_RW
)))
{
bio_get
(
bio
);
submit_bio
(
rw
,
bio
);
bio_put
(
bio
);
return
0
;
}
...
...
@@ -2136,6 +2143,7 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
* on a queue for later
*/
atomic_inc
(
&
root
->
fs_info
->
nr_async_submits
);
WARN_ON
(
bio
->
bi_next
);
bio
->
bi_next
=
NULL
;
bio
->
bi_rw
|=
rw
;
...
...
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