Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2019 17:07:08 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344365 - head/sys/geom
Message-ID:  <201902201707.x1KH78nd040260@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Feb 20 17:07:08 2019
New Revision: 344365
URL: https://svnweb.freebsd.org/changeset/base/344365

Log:
  Define a constant for the maximum number of GEOM_CTL arguments.
  
  Reviewed by:	eugen
  MFC with:	r344305
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D19271

Modified:
  head/sys/geom/geom_ctl.c
  head/sys/geom/geom_ctl.h

Modified: head/sys/geom/geom_ctl.c
==============================================================================
--- head/sys/geom/geom_ctl.c	Wed Feb 20 17:05:13 2019	(r344364)
+++ head/sys/geom/geom_ctl.c	Wed Feb 20 17:07:08 2019	(r344365)
@@ -139,7 +139,7 @@ gctl_copyin(struct gctl_req *req)
 	char *p;
 	u_int i;
 
-	if (req->narg > 2048) {
+	if (req->narg > GEOM_CTL_ARG_MAX) {
 		gctl_error(req, "too many arguments");
 		req->arg = NULL;
 		return;

Modified: head/sys/geom/geom_ctl.h
==============================================================================
--- head/sys/geom/geom_ctl.h	Wed Feb 20 17:05:13 2019	(r344364)
+++ head/sys/geom/geom_ctl.h	Wed Feb 20 17:07:08 2019	(r344365)
@@ -78,7 +78,8 @@ struct gctl_req {
 
 #define GEOM_CTL	_IOW('G', GCTL_VERSION, struct gctl_req)
 
-#define PATH_GEOM_CTL	"geom.ctl"
+#define GEOM_CTL_ARG_MAX 2048	/* maximum number of parameters */
 
+#define PATH_GEOM_CTL	"geom.ctl"
 
 #endif /* _GEOM_GEOM_CTL_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902201707.x1KH78nd040260>