xfs
[Top] [All Lists]

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

To: dag@xxxxxxxxx
Subject: Re: xfsdump hangs - 2.6.6 && 2.6.7-rc1-bk3
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 27 May 2004 09:18:49 +0100
Cc: nathans@xxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <20040527010946.9778.h018.c000.wm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxxxxxxxxx>, dag@xxxxxxxxx, nathans@xxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
References: <20040527010946.9778.h018.c000.wm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
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 */


<Prev in Thread] Current Thread [Next in Thread>