Skip to contentSkip to conversation

Patch "ext4: check for zero length extent explicitly" has been added to the 4.0-stable tree

PATCH [email protected] 1 participant 1 message Jun 3, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ext4: check for zero length extent explicitly

to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ext4-check-for-zero-length-extent-explicitly.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 2f974865ffdfe7b9f46a9940836c8b167342563d Mon Sep 17 00:00:00 2001

From: Eryu Guan <[email protected]>
Date: Thu, 14 May 2015 19:00:45 -0400
Subject: ext4: check for zero length extent explicitly

From: Eryu Guan <[email protected]>

commit 2f974865ffdfe7b9f46a9940836c8b167342563d upstream.

The following commit introduced a bug when checking for zero length extent

5946d08 ext4: check for overlapping extents in ext4_valid_extent_entries()

Zero length extent could pass the check if lblock is zero.

Adding the explicit check for zero length back.

---
 fs/ext4/extents.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents.c +1 -1
@@ -377,7 +377,7 @@ static int ext4_valid_extent(struct inod
 	ext4_lblk_t lblock = le32_to_cpu(ext->ee_block);
 	ext4_lblk_t last = lblock + len - 1;
 
-	if (lblock > last)
+	if (len == 0 || lblock > last)
 		return 0;
 	return ext4_data_block_valid(EXT4_SB(inode->i_sb), block, len);
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.0/ext4-check-for-zero-length-extent-explicitly.patch