Bug 20342

Summary: [LogFS] [2.6.36-rc7] Deadlock in logfs_get_wblocks, hold and wait on same lock super->s_write_mutex
Product: File System Reporter: Maciej Rutecki (maciej.rutecki)
Component: OtherAssignee: fs_other
Status: CLOSED CODE_FIX    
Severity: normal CC: florian, maciej.rutecki, prasadjoshi124, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.36-rc7 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 16444    
Attachments: do_logfs_journal_wl_pass() should use GFP_NOFS for memory allocation

Description Maciej Rutecki 2010-10-14 17:56:56 UTC
Subject    : [LogFS] [2.6.36-rc7] Deadlock in logfs_get_wblocks, hold and wait on same lock super->s_write_mutex
Submitter  : Prasad Joshi <prasadjoshi124@gmail.com>
Date       : 2010-10-13 9:49
Message-ID : AANLkTinvsMxTxEbDEFmb5M-6fYjdRvErU==Zs7+qANkV@mail.gmail.com
References : http://marc.info/?l=linux-kernel&m=128696335024718&w=2

This entry is being used for tracking a regression from 2.6.35. Please don't
close it until the problem is fixed in the mainline.
Comment 1 Prasad Gajanan Joshi. 2010-10-15 03:53:56 UTC
Created attachment 33672 [details]
do_logfs_journal_wl_pass() should use GFP_NOFS for memory allocation

GC code calls btree_insert32 with GFP_KERNEL while holding a mutex lock 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.
Comment 2 Florian Mickler 2010-11-16 15:27:59 UTC
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 )
Comment 3 Florian Mickler 2010-12-07 18:46:11 UTC
Patch: https://patchwork.kernel.org/patch/328682/