Skip to contentSkip to conversation

Patch "ext4: trim allocation requests to group size" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Mar 8, 2017

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: trim allocation requests to group size

to the 4.10-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-trim-allocation-requests-to-group-size.patch
and it can be found in the queue-4.10 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 cd648b8a8fd5071d232242d5ee7ee3c0815776af Mon Sep 17 00:00:00 2001

From: Jan Kara <[email protected]>
Date: Fri, 27 Jan 2017 14:34:30 -0500
Subject: ext4: trim allocation requests to group size

From: Jan Kara <[email protected]>

commit cd648b8a8fd5071d232242d5ee7ee3c0815776af upstream.

If filesystem groups are artifically small (using parameter -g to mkfs.ext4), ext4_mb_normalize_request() can result in a request that is larger than a block group. Trim the request size to not confuse allocation code.

---
 fs/ext4/mballoc.c |    7 +++++++
 1 file changed, 7 insertions(+)
fs/ext4/mballoc.c +7 -0
@@ -3123,6 +3123,13 @@ ext4_mb_normalize_request(struct ext4_al
 	if (ar->pright && start + size - 1 >= ar->lright)
 		size -= start + size - ar->lright;
 
+	/*
+	 * Trim allocation request for filesystems with artificially small
+	 * groups.
+	 */
+	if (size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb))
+		size = EXT4_BLOCKS_PER_GROUP(ac->ac_sb);
+
 	end = start + size;
 
 	/* check we don't cross already preallocated blocks */

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

queue-4.10/ext4-fix-data-corruption-in-data-journal-mode.patch queue-4.10/ext4-trim-allocation-requests-to-group-size.patch