lkml.org 
[lkml]   [2009]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [Jfs-discussion] [PATCH] jfs: lockdep fix
On Tue, 20 Oct 2009 15:00:23 -0500
Dave Kleikamp <shaggy@linux.vnet.ibm.com> wrote:
> I proposed another fix here:
> http://bugzilla.kernel.org/show_bug.cgi?id=13613
>
> It seems I haven't followed up and submitted it to the vfs maintainer.
> Could you please give that patch a try and see if it fixes the problem
> for you?
>

Your patch fixes the previously reported (old) lockdep problem. I am not able to trigger
the lockdep report while it takes a few minutes without the patch.

Tested-by: Krzysztof Helt <krzysztof.h1@wp.pl>

Your fix I have tested is below:

VFS: Fix potential deadlock in __read_cache_page()

lockdep reports a potential deadlock when using jfs because
add_to_page_cache_lru() is called from __read_cache_page() with GFP_KERNEL.

Detailed lockdep output can be found at
http://bugzilla.kernel.org/show_bug.cgi?id=13613

Passing mapping_gfp_mask(mapping) instead of GFP_KERNEL fixes the problem.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

diff --git a/mm/filemap.c b/mm/filemap.c
index ccea3b6..59f5406 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1702,7 +1702,8 @@ repeat:
page = page_cache_alloc_cold(mapping);
if (!page)
return ERR_PTR(-ENOMEM);
- err = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL);
+ err = add_to_page_cache_lru(page, mapping, index,
+ mapping_gfp_mask(mapping));
if (unlikely(err)) {
page_cache_release(page);
if (err == -EEXIST)


\
 
 \ /
  Last update: 2009-10-21 20:09    [W:0.065 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site