[PATCH 10/32] autofs-5.1.5 - Increase group buffer size geometrically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Joel Ebel <jbebel@xxxxxxxxxx>

Increase group buffer size geometrically rather than linearly
when its found to be small.

This prevents package to eat the cpu if you have large groups.
---
 CHANGELOG    |    1 +
 lib/mounts.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 64eb0926..b72711cb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -16,6 +16,7 @@ xx/xx/2019 autofs-5.1.6
 - Update README.
 - fix additional typing errors.
 - update autofs(8) offset map entry update description.
+- increase group buffer size geometrically.
 
 30/10/2018 autofs-5.1.5
 - fix flag file permission.
diff --git a/lib/mounts.c b/lib/mounts.c
index e4092d2f..5a8e8cdb 100644
--- a/lib/mounts.c
+++ b/lib/mounts.c
@@ -1539,7 +1539,7 @@ void set_tsd_user_vars(unsigned int logopt, uid_t uid, gid_t gid)
 		status = getgrgid_r(gid, pgr, gr_tmp, tmplen, ppgr);
 		if (status != ERANGE)
 			break;
-		tmplen += grplen;
+		tmplen *= 2;
 
 		/* Don't tempt glibc to alloca() larger than is (likely)
 		 * available on the stack if limit-getgrgid-size is enabled.




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux