Re: [PATCH 3/5] mpage writepages range limit fix

From: Suparna Bhattacharya
Date: Sun Aug 01 2004 - 02:46:23 EST


On Sun, Aug 01, 2004 at 01:15:18PM +0530, Suparna Bhattacharya wrote:
>
> The attached patches (generated against 2.6.8-rc2) enable concurrent
> O_SYNC writers to different parts of the same file by avoiding
> serialising on i_sem across the wait for IO completion.
>
> This is mostly your work, ported to the tagged radix tree VFS changes
> and a few fixes. I have been carrying these patches for sometime now;
> they can be the merged upstream. Please apply.
>

[3] fix-writepages-range.patch

Regards
Suparna

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

---------------------------------------------------------------

Safeguard to make sure we break out of pagevec_lookup_tag loop if we
are beyond the specified range.

Signed-off-by: Suparna Bhattacharya <suparna@xxxxxxxxxx>

linux-2.6.8-rc2-suparna/fs/mpage.c | 3 ++-
linux-2.6.8-rc2-suparna/fs/mpage.c.orig | 3 +--
2 files changed, 3 insertions(+), 3 deletions(-)

diff -puN fs/mpage.c~fix-writepages-range fs/mpage.c
--- linux-2.6.8-rc2/fs/mpage.c~fix-writepages-range 2004-08-01 12:33:10.000000000 +0530
+++ linux-2.6.8-rc2-suparna/fs/mpage.c 2004-08-01 12:33:10.000000000 +0530
@@ -649,7 +649,8 @@ mpage_writepages(struct address_space *m
scanned = 1;
}
retry:
- while (!done && (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
+ while (!done && (index <= end) &&
+ (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_DIRTY,
min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
unsigned i;
diff -puN fs/mpage.c.orig~fix-writepages-range fs/mpage.c.orig
--- linux-2.6.8-rc2/fs/mpage.c.orig~fix-writepages-range 2004-08-01 12:33:10.000000000 +0530
+++ linux-2.6.8-rc2-suparna/fs/mpage.c.orig 2004-08-01 12:32:43.000000000 +0530
@@ -649,8 +649,7 @@ mpage_writepages(struct address_space *m
scanned = 1;
}
retry:
- while (!done && (index <= end) &&
- (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
+ while (!done && (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_DIRTY,
min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
unsigned i;

_
-
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/