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>] [day] [month] [year] [list]
Date:	Thu, 24 Jan 2008 21:26:07 +0530
From:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	Theodore Y Tso <theotso@...ibm.com>, Mingming Cao <cmm@...ibm.com>,
	Alex Tomas <bzzz@....com>,
	Andreas Dilger <adilger@...sterfs.com>
Subject: GFP_ usage in kmalloc with mballoc

Hi,


I looked at the GFP flag usage in mballoc.  I think the below change
make sense with respect to mballoc.

First hunk is memory allocation during ext4_mb_init which is called
during mount time. I guess it is ok to convert that to GFP_KERNEL.

Second hunk is during ext4_mb_free_metadata. I guess it should be
GFP_NOFS. This is called during ext4_free_blocks.


diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index bec699a..a15f18e 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2662,7 +2662,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
 	sbi->s_mb_group_prealloc = MB_DEFAULT_GROUP_PREALLOC;
 
 	i = sizeof(struct ext4_locality_group) * NR_CPUS;
-	sbi->s_locality_groups = kmalloc(i, GFP_NOFS);
+	sbi->s_locality_groups = kmalloc(i, GFP_KERNEL);
 	if (sbi->s_locality_groups == NULL) {
 		clear_opt(sbi->s_mount_opt, MBALLOC);
 		kfree(sbi->s_mb_offsets);
@@ -4366,7 +4366,7 @@ static int ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b,
 
 		if (md == NULL) {
 			ext4_unlock_group(sb, group);
-			md = kmalloc(sizeof(*md), GFP_KERNEL);
+			md = kmalloc(sizeof(*md), GFP_NOFS);
 			if (md == NULL)
 				return -ENOMEM;
 			md->num = 0;
-
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