]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/ext4-avoid-corrupting-the-uninitialized-bit-in-the-extent-during-truncate
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / ext4-avoid-corrupting-the-uninitialized-bit-in-the-extent-during-truncate
CommitLineData
2cb7cef9
BS
1From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2Date: Wed, 10 Jun 2009 18:22:55 +0000 (-0400)
3Subject: ext4: Avoid corrupting the uninitialized bit in the extent during truncate
4Patch-mainline: 2.6.31-rc1
5Git-commit: a41f20716975910d9beb90b7efc61107901492b8
6References: bnc#514265
7
8ext4: Avoid corrupting the uninitialized bit in the extent during truncate
9
10The unitialized bit was not properly getting preserved in in an extent
11which is partially truncated because the it was geting set to the
12value of the first extent to be removed or truncated as part of the
13truncate operation, and if there are multiple extents are getting
14removed or modified as part of the truncate operation, it is only the
15last extent which will might be partially truncated, and its
16uninitalized bit is not necessarily the same as the first extent to be
17truncated.
18
19Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
20Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
21Acked-by: Jeff Mahoney <jeffm@suse.com>
22---
23
24 fs/ext4/extents.c | 8 ++++++--
25 1 file changed, 6 insertions(+), 2 deletions(-)
26
27--- a/fs/ext4/extents.c
28+++ b/fs/ext4/extents.c
29@@ -1877,12 +1877,16 @@ ext4_ext_rm_leaf(handle_t *handle, struc
30 ex = EXT_LAST_EXTENT(eh);
31
32 ex_ee_block = le32_to_cpu(ex->ee_block);
33- if (ext4_ext_is_uninitialized(ex))
34- uninitialized = 1;
35 ex_ee_len = ext4_ext_get_actual_len(ex);
36
37 while (ex >= EXT_FIRST_EXTENT(eh) &&
38 ex_ee_block + ex_ee_len > start) {
39+
40+ if (ext4_ext_is_uninitialized(ex))
41+ uninitialized = 1;
42+ else
43+ uninitialized = 0;
44+
45 ext_debug("remove ext %lu:%u\n", ex_ee_block, ex_ee_len);
46 path[depth].p_ext = ex;
47