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  linux-cve-announce  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]
Message-ID: <ac8f92701003250824q6aeeac4cw55cb0d913e5a3bd3@mail.gmail.com>
Date:	Thu, 25 Mar 2010 23:24:13 +0800
From:	jing zhang <zj.barak@...il.com>
To:	linux-ext4 <linux-ext4@...r.kernel.org>
Cc:	"Theodore Ts'o" <tytso@....edu>, Andreas Dilger <adilger@....com>,
	Dave Kleikamp <shaggy@...ux.vnet.ibm.com>,
	"Aneesh Kumar K. V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH 1/2] ext4: try to relieve ext4_mb_discard_group_preallocations() 
	from hard work in simple way

From: Jing Zhang <zj.barak@...il.com>

Date: Wed Mar 25  23:15:06     2010

The function, ext4_mb_discard_group_preallocations(), works alone as
hard as possible without correct understanding its caller's good
thinking.

And now try to relieve it in simple way.

But the variable, free, may be replaced with freed.

Cc: Theodore Ts'o <tytso@....edu>
Cc: Andreas Dilger <adilger@....com>
Cc: Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
Cc: "Aneesh Kumar K. V" <aneesh.kumar@...ux.vnet.ibm.com>
Signed-off-by: Jing Zhang <zj.barak@...il.com>

---

--- linux-2.6.32/fs/ext4/mballoc.c	2009-12-03 11:51:22.000000000 +0800
+++ ext4_mm_leak/mballoc-11-1.c	2010-03-25 23:06:00.000000000 +0800
@@ -3633,7 +3633,7 @@ repeat:
 		spin_lock(&pa->pa_lock);
 		if (atomic_read(&pa->pa_count)) {
 			spin_unlock(&pa->pa_lock);
-			busy = 1;
+			busy += 1;
 			continue;
 		}
 		if (pa->pa_deleted) {
@@ -3654,7 +3654,7 @@ repeat:
 	}

 	/* if we still need more blocks and some PAs were used, try again */
-	if (free < needed && busy) {
+	if (free < needed && needed <= free + busy) {
 		busy = 0;
 		ext4_unlock_group(sb, group);
 		/*
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ