lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  7 Mar 2019 14:49:14 +0300
From:   Artem Blagodarenko <artem.blagodarenko@...il.com>
To:     linux-ext4@...r.kernel.org
Cc:     adilger.kernel@...ger.ca, alexey.lyashkov@...il.com
Subject: [PATCH] ext4: check if group has free space

Regular allocator make four groups processing loops to
find good group to allocate blocks. On 4th loop it accept any
group, even if there is no free space at all.

This patch adds group free space check to skip full groups.

Sigend-off-by: Artem Blagodarenko <c17828@...y.com>
---
 fs/ext4/mballoc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index e2248083cdca..4e6c36ff1d55 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2087,7 +2087,8 @@ static int ext4_mb_good_group(struct ext4_allocation_context *ac,
 			return 1;
 		break;
 	case 3:
-		return 1;
+		/* Skip group without any free space */
+		return free ? 1 : 0;
 	default:
 		BUG();
 	}
-- 
2.14.3

Powered by blists - more mailing lists