[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200910292011.n9TKB8B0017201@demeter.kernel.org>
Date: Thu, 29 Oct 2009 20:11:08 GMT
From: bugzilla-daemon@...zilla.kernel.org
To: linux-ext4@...r.kernel.org
Subject: [Bug 14354] Bad corruption with 2.6.32-rc1 and upwards
http://bugzilla.kernel.org/show_bug.cgi?id=14354
--- Comment #143 from Mingming Cao <cmm@...ibm.com> 2009-10-29 20:11:04 ---
On Tue, 2009-10-27 at 15:45 +0530, Aneesh Kumar K.V wrote:
> Can you try this patch ?
>
> commit a8836b1d6f92273e001012c7705ae8f4c3d5fb65
> Author: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
> Date: Tue Oct 27 15:36:38 2009 +0530
>
> ext4: discard preallocation during truncate
>
> We need to make sure when we drop and reacquire the inode's
> i_data_sem we discard the inode preallocation. Otherwise we
> could have blocks marked as free in bitmap but still belonging
> to prealloc space.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
>
Make sense, reviewed-by: Mingming Cao <cmm@...ibm.com>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 5c5bc5d..a1ef1c3 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -209,6 +209,12 @@ static int try_to_extend_transaction(handle_t *handle, struct inode *inode)
> up_write(&EXT4_I(inode)->i_data_sem);
> ret = ext4_journal_restart(handle, blocks_for_truncate(inode));
> down_write(&EXT4_I(inode)->i_data_sem);
> + /*
> + * We have dropped i_data_sem. So somebody else could have done
> + * block allocation. So discard the prealloc space created as a
> + * part of block allocation
> + */
> + ext4_discard_preallocations(inode);
>
> return ret;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists