summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChen, Kenneth W <kenneth.w.chen@intel.com>2007-01-22 20:40:43 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-23 07:52:06 -0800
commitcda9205da24aeaa8fb086b0fb85cdf39571ecc3f (patch)
treec302c3d0b0558d3fc5ac0b5750e4f8150517ece5 /fs
parent15c945c3d0913d73a7d57d7a0a3c4e2902598cc6 (diff)
[PATCH] fix blk_direct_IO bio preparation
For large size DIO that needs multiple bio, one full page worth of data was lost at the boundary of bio's maximum sector or segment limits. After a bio is full and got submitted. The outer while (nbytes) { ... } loop will allocate a new bio and just march on to index into next page. It just forgets about the page that bio_add_page() rejected when previous bio is full. Fix it by put the rejected page back to pvec so we pick it up again for the next bio. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/block_dev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index da020be25dd2..d9bdf2b3ade2 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -190,6 +190,12 @@ static struct page *blk_get_page(unsigned long addr, size_t count, int rw,
return pvec->page[pvec->idx++];
}
+/* return a page back to pvec array */
+static void blk_unget_page(struct page *page, struct pvec *pvec)
+{
+ pvec->page[--pvec->idx] = page;
+}
+
static ssize_t
blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
loff_t pos, unsigned long nr_segs)
@@ -278,6 +284,8 @@ same_bio:
count = min(count, nbytes);
goto same_bio;
}
+ } else {
+ blk_unget_page(page, &pvec);
}
/* bio is ready, submit it */
=cbbc79a53278b83bf7f834127751459f9299e402'>perf report: Add multiple event supportEric B Munson2010-03-101-15/+100 | * perf session: Change perf_session post processing functions to take histogram...Eric B Munson2010-03-105-32/+38 | * perf session: Add storage for seperating event types in reportEric B Munson2010-03-103-0/+11 | * perf session: Change add_hist_entry to take the tree root instead of sessionEric B Munson2010-03-105-7/+10 | * perf record: Add ID and to recorded event data when recording multiple eventsEric B Munson2010-03-101-0/+3 | * perf probe: Add missing variable initializationArnaldo Carvalho de Melo2010-03-101-1/+1 | * perf tools: Don't trow away old map slices not overlapped by new mapsArnaldo Carvalho de Melo2010-03-101-3/+32 * | Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/ker...Linus Torvalds2010-03-137-9/+182 |\| | * Merge commit 'v2.6.34-rc1' into perf/urgentIngo Molnar2010-03-098-626/+644 | |\ | * | perf trace: Don't use pager if scriptingTom Zanussi2010-03-041-1/+2 | * | perf trace/scripting: Remove extraneous header readTom Zanussi2010-03-041-1/+0 | * | perf, ARM: Modify kuser rmb() call to compile for Thumb-2Will Deacon2010-03-041-3/+1 | * | perf archive: Don't try to collect files without a build-idArnaldo Carvalho de Melo2010-03-021-1/+2 | * | perf lock: Drop the buffers multiplexing dependencyFrederic Weisbecker2010-02-271-2/+146 | * | perf lock: Fix and add misc documentally thingsHitoshi Mitake2010-02-272-0/+30 | * | Merge commit 'v2.6.33' into perf/coreFrederic Weisbecker2010-02-273-3/+6 | |\ \ * | \ \ Merge branch 'for-next' into for-linusJiri Kosina2010-03-082-2/+2 |\ \ \ \ | |_|_|/ |/| | | | * | | tree-wide: Assorted spelling fixesDaniel Mack2010-02-091-1/+1 | * | | fix typos "precidence" -> "precedence" in commentsUwe Kleine-König2010-02-051-1/+1 * | | | Merge branch 'perf-probes-for-linus-2' of git://git.kernel.org/pub/scm/linux/...Linus Torvalds2010-03-058-626/+644 |\ \ \ \ | * | | | perf probe: Correct probe syntax on command line helpMasami Hiramatsu2010-03-041-1/+1 | * | | | perf probe: Add lazy line matching supportMasami Hiramatsu2010-02-257-99/+298 | * | | | perf probe: Show more lines after last lineMasami Hiramatsu2010-02-251-0/+7 | * | | | perf probe: Check function address range strictly in line finderMasami Hiramatsu2010-02-252-23/+53 | * | | | perf probe: Use libdw callback routinesMasami Hiramatsu2010-02-252-177/+86 | * | | | perf probe: Use elfutils-libdw for analyzing debuginfoMasami Hiramatsu2010-02-254-466/+314 | * | | | perf probe: Rename probe finder functionsMasami Hiramatsu2010-02-253-8/+8 | * | | | perf probe: Fix bugs in line range finderMasami Hiramatsu2010-02-251-2/+1 | * | | | perf probe: Update perf probe documentMasami Hiramatsu2010-02-251-2/+26 | * | | | perf probe: Do not show --line option without dwarf supportMasami Hiramatsu2010-02-251-0/+2 * | | | | Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kern...Linus Torvalds2010-02-2888-1331/+5576 |\ \ \ \ \ | | |_|/ / | |/| | / | |_|_|/ |/| | |