Skip to contentSkip to conversation

nfsdctl: fix lockd config during autostart

PATCH In review Scott Mayhew 3 participants 3 messages May 1, 2025 – May 7, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsdctl: fix lockd config during autostart

Be sure to actually send the lockd config values over the netlink interface.

While we're at it, get rid of the unused "ret" variable.

Fixes f61c2ff8 ("nfsdctl: add necessary bits to configure lockd")
---
 utils/nfsdctl/nfsdctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
utils/nfsdctl/nfsdctl.c +2 -1
index 733756a9..ae435932 100644
@@ -1417,7 +1417,6 @@ static int lockd_configure(struct nl_sock *sock, int grace)
 {
 	char *tcp_svc, *udp_svc;
 	int tcpport = 0, udpport = 0;
-	int ret;
 
 	tcp_svc = conf_get_str("lockd", "port");
 	if (tcp_svc) {
@@ -1432,6 +1431,8 @@ static int lockd_configure(struct nl_sock *sock, int grace)
 		if (udpport < 0)
 			return 1;
 	}
+
+	return lockd_config_doit(sock, LOCKD_CMD_SERVER_SET, grace, tcpport, udpport);
 }
 
 static int
Signature · 1 line
2.48.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Scott Mayhew

Be sure to actually send the lockd config values over the netlink interface.

While we're at it, get rid of the unused "ret" variable.

Fixes f61c2ff8 ("nfsdctl: add necessary bits to configure lockd")
---
 utils/nfsdctl/nfsdctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
utils/nfsdctl/nfsdctl.c +0 -1
index 733756a9..ae435932 100644
@@ -1417,7 +1417,6 @@ static int lockd_configure(struct nl_sock *sock, int grace)
 {
 	char *tcp_svc, *udp_svc;
 	int tcpport = 0, udpport = 0;
-	int ret;
 
 	tcp_svc = conf_get_str("lockd", "port");
 	if (tcp_svc) {

utils/nfsdctl/nfsdctl.c static int lockd_configure(struct nl_sock *sock, int grace) · line 1438

Quoted 8 lines
utils/nfsdctl/nfsdctl.c +2 -0
@@ -1432,6 +1431,8 @@ static int lockd_configure(struct nl_sock *sock, int grace)
 		if (udpport < 0)
 			return 1;
 	}
+
+	return lockd_config_doit(sock, LOCKD_CMD_SERVER_SET, grace, tcpport, udpport);
 }
 
 static int

Doh! Good catch!

#2 lore raw
In reply to Scott Mayhew
Quoted 7 lines · Scott Mayhew

Be sure to actually send the lockd config values over the netlink interface.

While we're at it, get rid of the unused "ret" variable.

Fixes f61c2ff8 ("nfsdctl: add necessary bits to configure lockd")

Committed... (tag: nfs-utils-2-8-4-rc1)

steved.

Quoted 25 lines
---
  utils/nfsdctl/nfsdctl.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
utils/nfsdctl/nfsdctl.c +2 -1
index 733756a9..ae435932 100644
@@ -1417,7 +1417,6 @@ static int lockd_configure(struct nl_sock *sock, int grace)
  {
  	char *tcp_svc, *udp_svc;
  	int tcpport = 0, udpport = 0;
-	int ret;
 
  	tcp_svc = conf_get_str("lockd", "port");
  	if (tcp_svc) {
@@ -1432,6 +1431,8 @@ static int lockd_configure(struct nl_sock *sock, int grace)
  		if (udpport < 0)
  			return 1;
  	}
+
+	return lockd_config_doit(sock, LOCKD_CMD_SERVER_SET, grace, tcpport, udpport);
  }
 
  static int