[3.19.y-ckt stable] Patch "ext4: fix loss of delalloc extent info in ext4_zero_range()" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Thu Sep 24 18:19:12 UTC 2015


This is a note to let you know that I have just added a patch titled

    ext4: fix loss of delalloc extent info in ext4_zero_range()

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue

This patch is scheduled to be released in version 3.19.8-ckt7.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 68e8fb56288a78161e4d7bd05b9e391c6b40eb2c Mon Sep 17 00:00:00 2001
From: Eric Whitney <enwlinux at gmail.com>
Date: Fri, 3 Apr 2015 00:13:42 -0400
Subject: ext4: fix loss of delalloc extent info in ext4_zero_range()

commit 94426f4b9648154dc5a6760b59e6953e640ab3b1 upstream.

In ext4_zero_range(), removing a file's entire block range from the
extent status tree removes all records of that file's delalloc extents.
The delalloc accounting code uses this information, and its loss can
then lead to accounting errors and kernel warnings at writeback time and
subsequent file system damage.  This is most noticeable on bigalloc
file systems where code in ext4_ext_map_blocks() handles cases where
delalloc extents share clusters with a newly allocated extent.

Because we're not deleting a block range and are correctly updating the
status of its associated extent, there is no need to remove anything
from the extent status tree.

When this patch is combined with an unrelated bug fix for
ext4_zero_range(), kernel warnings and e2fsck errors reported during
xfstests runs on bigalloc filesystems are greatly reduced without
introducing regressions on other xfstests-bld test scenarios.

Signed-off-by: Eric Whitney <enwlinux at gmail.com>
Signed-off-by: Theodore Ts'o <tytso at mit.edu>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 fs/ext4/extents.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 4252860..3292cd9 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4854,19 +4854,6 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 					     flags, mode);
 		if (ret)
 			goto out_dio;
-		/*
-		 * Remove entire range from the extent status tree.
-		 *
-		 * ext4_es_remove_extent(inode, lblk, max_blocks) is
-		 * NOT sufficient.  I'm not sure why this is the case,
-		 * but let's be conservative and remove the extent
-		 * status tree for the entire inode.  There should be
-		 * no outstanding delalloc extents thanks to the
-		 * filemap_write_and_wait_range() call above.
-		 */
-		ret = ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS);
-		if (ret)
-			goto out_dio;
 	}
 	if (!partial_begin && !partial_end)
 		goto out_dio;
--
1.9.1





More information about the kernel-team mailing list