From: "Aneesh Kumar K.V" Subject: Re: double free of blocks occurred during online defrag Date: Wed, 25 Feb 2009 16:14:46 +0530 Message-ID: <20090225104446.GA25714@skywalker> References: <49A4E7B8.2040804@sx.jp.nec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-ext4@vger.kernel.org To: Kazuya Mio Return-path: Received: from e23smtp03.au.ibm.com ([202.81.31.145]:58986 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757022AbZBYKpI (ORCPT ); Wed, 25 Feb 2009 05:45:08 -0500 Received: from d23relay01.au.ibm.com (d23relay01.au.ibm.com [202.81.31.243]) by e23smtp03.au.ibm.com (8.13.1/8.13.1) with ESMTP id n1PAhPpS023352 for ; Wed, 25 Feb 2009 21:43:25 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay01.au.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n1PAjNLo413958 for ; Wed, 25 Feb 2009 21:45:23 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n1PAj5jh012205 for ; Wed, 25 Feb 2009 21:45:05 +1100 Content-Disposition: inline In-Reply-To: <49A4E7B8.2040804@sx.jp.nec.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Wed, Feb 25, 2009 at 03:39:52PM +0900, Kazuya Mio wrote: > Hi Aneesh, > > When I remove the file that is running online defrag, the following error occurs > after closing the file descriptor: > > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): > ext4_mb_release_inode_pa: free 2048, pa_free 1562 > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): mb_free_blocks: > double-free of inode 0's block 802817(bit 0 in group 98) > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): mb_free_blocks: > double-free of inode 0's block 802818(bit 1 in group 98) > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): mb_free_blocks: > double-free of inode 0's block 802819(bit 2 in group 98) > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): mb_free_blocks: > double-free of inode 0's block 802820(bit 3 in group 98) > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): mb_free_blocks: > double-free of inode 0's block 802821(bit 4 in group 98) > Jan 22 17:06:52 G3-OPC-SVR2 kernel: EXT4-fs error (device hda8): mb_free_blocks: > double-free of inode 0's block 802822(bit 5 in group 98) > > So, online defrag calls ext4_discard_preallocations() at the end of > ext4_defrag() to avoid double-free error. > However, above error hasn't occurred since applying your patch posted on Nov > 6th, 2008 because this error is caused by the same reason of your report. > http://marc.info/?l=linux-ext4&m=122599787406193&w=4 > > What is the status of this patch? We dropped the patch because I found that the double free in my case was not exactly due the explanation given in the patch above. I asked to drop the patch in http://article.gmane.org/gmane.comp.file-systems.ext4/10199 I also found that the patch is not completely correct. The meta-data blocks which are added to the free_list are not allocated from any prealloc space. So what you are seeing may be a different problem which the patch is hiding from happening. I guess you will have to look more closely at why the double-free is happening in your case. -aneesh