diff options
author | Prasad Joshi <prasadjoshi124@gmail.com> | 2010-12-21 20:24:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-22 22:43:33 -0500 |
commit | eabb26cacdec33ca6f6fcaee762b57c2205169ca (patch) | |
tree | aa6975de08a6843d7d23f741644b2b3fca2980b4 | |
parent | 7a2d19bced51af31d2c9ff55219400ed0a6c012f (diff) |
logfs: fix deadlock in logfs_get_wblocks, hold and wait on super->s_write_mutex
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(), and a
call to writepage() could be triggered as a result of memory allocation
in btree_insert32, causing a deadlock.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=20342
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Joern Engel <joern@logfs.org>
Cc: Florian Mickler <florian@mickler.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/logfs/journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/logfs/journal.c b/fs/logfs/journal.c index f46ee8b0e135..9da29706f91c 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) | |||
828 | super->s_journal_seg[i] = segno; | 828 | super->s_journal_seg[i] = segno; |
829 | super->s_journal_ec[i] = ec; | 829 | super->s_journal_ec[i] = ec; |
830 | logfs_set_segment_reserved(sb, segno); | 830 | logfs_set_segment_reserved(sb, segno); |
831 | err = btree_insert32(head, segno, (void *)1, GFP_KERNEL); | 831 | err = btree_insert32(head, segno, (void *)1, GFP_NOFS); |
832 | BUG_ON(err); /* mempool should prevent this */ | 832 | BUG_ON(err); /* mempool should prevent this */ |
833 | err = logfs_erase_segment(sb, segno, 1); | 833 | err = logfs_erase_segment(sb, segno, 1); |
834 | BUG_ON(err); /* FIXME: remount-ro would be nicer */ | 834 | BUG_ON(err); /* FIXME: remount-ro would be nicer */ |