[PATCH v1 1/2] _rpc_dtablesize: Decrease the value of size.

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

 



To fix the bug caused by a Size value that is too large and leads to an array
that requires excessive memory, which subsequently results in the failure of
rpcbind to start properly.

Signed-off-by: Zhuohao Bai <zhuohao_bai@xxxxxxxxxxx>
---
 src/rpc_dtablesize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc_dtablesize.c b/src/rpc_dtablesize.c
index bce97e8..12f80c1 100644
--- a/src/rpc_dtablesize.c
+++ b/src/rpc_dtablesize.c
@@ -41,7 +41,7 @@ _rpc_dtablesize(void)
 	static int size;
 
 	if (size == 0) {
-		size = sysconf(_SC_OPEN_MAX);
+		size = min(1024, sysconf(_SC_OPEN_MAX));
 	}
 	return (size);
 }
-- 
2.25.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux