From: Prasad Joshi <prasadjoshi124@gmail.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>,
linux-fsdevel@kernel.org, Joern <joern@logfs.org>,
florian@mickler.org
Subject: [PATCH 1/1] LogFS: Deadlock in logfs_get_wblocks, hold and wait on super->s_write_mutex
Date: Tue, 16 Nov 2010 16:38:36 +0000 [thread overview]
Message-ID: <AANLkTi=BEkybzx4=cJoboXQbKsUb62Yrqz6RLoxd-Qyb@mail.gmail.com> (raw)
do_logfs_journal_wl_pass() should use GFP_NOFS for memory allocation
GC code calls btree_insert32 with GFP_KERNEL while holding a mutex
super->s_write_mutex. The same mutex is used in
address_space_operations->writepage(). Call to writepage() could be triggered
as a result of memory allocation in btree_insert32, causing a deadlock.
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
---
diff --git a/fs/logfs/journal.c b/fs/logfs/journal.c
index f46ee8b..9da2970 100644
--- a/fs/logfs/journal.c
+++ b/fs/logfs/journal.c
@@ -828,7 +828,7 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
super->s_journal_seg[i] = segno;
super->s_journal_ec[i] = ec;
logfs_set_segment_reserved(sb, segno);
- err = btree_insert32(head, segno, (void *)1, GFP_KERNEL);
+ err = btree_insert32(head, segno, (void *)1, GFP_NOFS);
BUG_ON(err); /* mempool should prevent this */
err = logfs_erase_segment(sb, segno, 1);
BUG_ON(err); /* FIXME: remount-ro would be nicer */
---------- Forwarded message ----------
From: <bugzilla-daemon@bugzilla.kernel.org>
Date: Tue, Nov 16, 2010 at 3:28 PM
Subject: [Bug 20342] [LogFS] [2.6.36-rc7] Deadlock in
logfs_get_wblocks, hold and wait on same lock super->s_write_mutex
To: prasadjoshi124@gmail.com
https://bugzilla.kernel.org/show_bug.cgi?id=20342
Florian Mickler <florian@mickler.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |florian@mickler.org
--- Comment #2 from Florian Mickler <florian@mickler.org> 2010-11-16
15:27:59 ---
Please submit this patch on lkml and the logfs mailinglist for review. The
logfs maintainers seem to not be aware of the bugzilla.
( Documentation/SubmittingPatches )
--
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
reply other threads:[~2010-11-16 16:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='AANLkTi=BEkybzx4=cJoboXQbKsUb62Yrqz6RLoxd-Qyb@mail.gmail.com' \
--to=prasadjoshi124@gmail.com \
--cc=florian@mickler.org \
--cc=joern@logfs.org \
--cc=linux-fsdevel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).