Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
7eb9b2f5
Commit
7eb9b2f5
authored
19 years ago
by
Linus Torvalds
Browse files
Options
Downloads
Plain Diff
Merge
git://oss.sgi.com:8090/oss/git/xfs-2.6
parents
728c7763
d88992f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fs/xfs/linux-2.6/xfs_aops.c
+26
-3
26 additions, 3 deletions
fs/xfs/linux-2.6/xfs_aops.c
with
26 additions
and
3 deletions
fs/xfs/linux-2.6/xfs_aops.c
+
26
−
3
View file @
7eb9b2f5
...
...
@@ -336,24 +336,47 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)
}
/*
* Submit all of the bios for all of the ioends we have saved up,
* covering the initial writepage page and also any probed pages.
* Submit all of the bios for all of the ioends we have saved up, covering the
* initial writepage page and also any probed pages.
*
* Because we may have multiple ioends spanning a page, we need to start
* writeback on all the buffers before we submit them for I/O. If we mark the
* buffers as we got, then we can end up with a page that only has buffers
* marked async write and I/O complete on can occur before we mark the other
* buffers async write.
*
* The end result of this is that we trip a bug in end_page_writeback() because
* we call it twice for the one page as the code in end_buffer_async_write()
* assumes that all buffers on the page are started at the same time.
*
* The fix is two passes across the ioend list - one to start writeback on the
* bufferheads, and then the second one submit them for I/O.
*/
STATIC
void
xfs_submit_ioend
(
xfs_ioend_t
*
ioend
)
{
xfs_ioend_t
*
head
=
ioend
;
xfs_ioend_t
*
next
;
struct
buffer_head
*
bh
;
struct
bio
*
bio
;
sector_t
lastblock
=
0
;
/* Pass 1 - start writeback */
do
{
next
=
ioend
->
io_list
;
for
(
bh
=
ioend
->
io_buffer_head
;
bh
;
bh
=
bh
->
b_private
)
{
xfs_start_buffer_writeback
(
bh
);
}
}
while
((
ioend
=
next
)
!=
NULL
);
/* Pass 2 - submit I/O */
ioend
=
head
;
do
{
next
=
ioend
->
io_list
;
bio
=
NULL
;
for
(
bh
=
ioend
->
io_buffer_head
;
bh
;
bh
=
bh
->
b_private
)
{
xfs_start_buffer_writeback
(
bh
);
if
(
!
bio
)
{
retry:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment