Re: xfsdump hangs - 2.6.6 && 2.6.7-rc1-bk3

From: Christoph Hellwig
Date: Thu May 27 2004 - 03:20:15 EST


My patch still wasn't complete, you're still leaking pages, just not
locked ones, this patch should be better and I'll check it in in a few
minutes:


--- 1.111/fs/xfs/linux/xfs_buf.c 2004-04-28 06:45:14 +02:00
+++ edited/fs/xfs/linux/xfs_buf.c 2004-05-27 08:38:46 +02:00
@@ -359,6 +359,7 @@
error = _pagebuf_get_pages(bp, page_count, flags);
if (unlikely(error))
return error;
+ bp->pb_flags |= _PBF_PAGE_CACHE;

offset = bp->pb_offset;
first = bp->pb_file_offset >> PAGE_CACHE_SHIFT;
@@ -370,8 +371,12 @@
retry:
page = find_or_create_page(mapping, first + i, gfp_mask);
if (unlikely(page == NULL)) {
- if (flags & PBF_READ_AHEAD)
+ if (flags & PBF_READ_AHEAD) {
+ bp->pb_page_count = i;
+ for (i = 0; i < bp->pb_page_count; i++)
+ unlock_page(bp->pb_pages[i]);
return -ENOMEM;
+ }

/*
* This could deadlock.
@@ -426,8 +431,6 @@
for (i = 0; i < bp->pb_page_count; i++)
unlock_page(bp->pb_pages[i]);
}
-
- bp->pb_flags |= _PBF_PAGE_CACHE;

if (page_count) {
/* if we have any uptodate pages, mark that in the buffer */
-
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/