From patchwork Tue Oct 27 06:39:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@bugzilla.kernel.org X-Patchwork-Id: 36967 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 3894DB7B9D for ; Tue, 27 Oct 2009 17:39:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756201AbZJ0Gjq (ORCPT ); Tue, 27 Oct 2009 02:39:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756258AbZJ0Gjq (ORCPT ); Tue, 27 Oct 2009 02:39:46 -0400 Received: from demeter.kernel.org ([140.211.167.39]:35357 "EHLO demeter.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756201AbZJ0Gjq (ORCPT ); Tue, 27 Oct 2009 02:39:46 -0400 Received: from demeter.kernel.org (localhost.localdomain [127.0.0.1]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9R6do1l018079 for ; Tue, 27 Oct 2009 06:39:50 GMT Received: (from bugzilla@localhost) by demeter.kernel.org (8.14.2/8.14.2/Submit) id n9R6dosP018078; Tue, 27 Oct 2009 06:39:50 GMT Date: Tue, 27 Oct 2009 06:39:50 GMT Message-Id: <200910270639.n9R6dosP018078@demeter.kernel.org> X-Authentication-Warning: demeter.kernel.org: bugzilla set sender to bugzilla-daemon@bugzilla.kernel.org using -f From: bugzilla-daemon@bugzilla.kernel.org To: linux-ext4@vger.kernel.org Subject: [Bug 14354] Bad corruption with 2.6.32-rc1 and upwards X-Bugzilla-Reason: None X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: AssignedTo fs_ext4@kernel-bugs.osdl.org X-Bugzilla-Product: File System X-Bugzilla-Component: ext4 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aneesh.kumar@linux.vnet.ibm.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: fs_ext4@kernel-bugs.osdl.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: Auto-Submitted: auto-generated MIME-Version: 1.0 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org http://bugzilla.kernel.org/show_bug.cgi?id=14354 --- Comment #122 from Aneesh Kumar K.V 2009-10-27 06:39:41 --- Can you test with the below patch Commit 487caeef9fc08c0565e082c40a8aaf58dad92bbb fixed a deadlock between get_block and truncate by dropping the i_data_sem during truncate. But i guess we should make sure we drop any preallocation that we did as a part of the block allocation. Otherwise we definitely can get multiple claimed blocks. But this can happen only if we have block allocation and truncate happening on the same file simultaneously. With delayed allocation i guess it is possible that pdflush tries to do block allocation while application does a truncate diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 10539e3..14539b5 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -113,6 +113,7 @@ static int ext4_ext_truncate_extend_restart(handle_t *handle, */ ext4_ext_invalidate_cache(inode); + ext4_discard_preallocations(inode); return err; }