mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Helt <krzysztof.h1@wp.pl>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	jfs-discussion@lists.sourceforge.net
Subject: Re: [Jfs-discussion] [PATCH] jfs: lockdep fix
Date: Wed, 21 Oct 2009 20:25:04 +0200	[thread overview]
Message-ID: <20091021202504.0daf2be7.krzysztof.h1@wp.pl> (raw)
In-Reply-To: <1256068823.3708.30.camel@norville.austin.ibm.com>

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)


      parent reply	other threads:[~2009-10-21 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 18:48 Krzysztof Helt
2009-10-20 20:00 ` [Jfs-discussion] " Dave Kleikamp
2009-10-21  6:24   ` Krzysztof Helt
2009-10-21 18:25   ` Krzysztof Helt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091021202504.0daf2be7.krzysztof.h1@wp.pl \
    --to=krzysztof.h1@wp.pl \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaggy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®