Re: [PATCH 19/22] Fix math error in AIO wait on writeback

From: Suparna Bhattacharya
Date: Fri Jul 02 2004 - 11:33:24 EST


On Fri, Jul 02, 2004 at 06:30:30PM +0530, Suparna Bhattacharya wrote:
> The patchset contains modifications and fixes to the AIO core
> to support the full retry model, an implementation of AIO
> support for buffered filesystem AIO reads and O_SYNC writes
> (the latter courtesy O_SYNC speedup changes from Andrew Morton),
> an implementation of AIO reads and writes to pipes (from
> Chris Mason) and AIO poll (again from Chris Mason).
>
> Full retry infrastructure and fixes
> [1] aio-retry.patch
> [2] 4g4g-aio-hang-fix.patch
> [3] aio-retry-elevated-refcount.patch
> [4] aio-splice-runlist.patch
>
> FS AIO read
> [5] aio-wait-page.patch
> [6] aio-fs_read.patch
> [7] aio-upfront-readahead.patch
>
> AIO for pipes
> [8] aio-cancel-fix.patch
> [9] aio-read-immediate.patch
> [10] aio-pipe.patch
> [11] aio-context-switch.patch
>
> Concurrent O_SYNC write speedups using radix-tree walks
> [12] writepages-range.patch
> [13] fix-writeback-range.patch
> [14] fix-writepages-range.patch
> [15] fdatawrite-range.patch
> [16] O_SYNC-speedup.patch
>
> AIO O_SYNC write
> [17] aio-wait_on_page_writeback_range.patch
> [18] aio-O_SYNC.patch
> [19] O_SYNC-write-fix.patch
>

--
Suparna Bhattacharya (suparna@xxxxxxxxxx)
Linux Technology Center
IBM Software Lab, India
-----------------------------------------------------------

From: Chris Mason <mason@xxxxxxxx>

BUG 40701 correct math errors for aio O_SYNC writes that lead
to the aio code thinking the write is complete while we are still
waiting for some pages


filemap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)


--- aio/mm/filemap.c 2004-06-26 15:50:43.132941192 -0700
+++ O_SYNC-write/mm/filemap.c 2004-06-26 16:01:26.559125544 -0700
@@ -208,7 +208,7 @@ static ssize_t wait_on_page_writeback_ra
struct pagevec pvec;
int nr_pages;
int ret = 0, done = 0;
- pgoff_t index, curr = start;
+ pgoff_t index;

if (end < start)
return 0;
@@ -232,12 +232,9 @@ static ssize_t wait_on_page_writeback_ra
unlock_page(page);
continue;
}
- curr = page->index;
unlock_page(page);
ret = wait_on_page_writeback_wq(page, wait);
if (ret == -EIOCBRETRY) {
- if (curr > start)
- ret = curr - start;
done = 1;
break;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/