Skip to contentSkip to conversation

dlm: don't warn when closing a node without a connection

PATCH In review vienna-0FFH 2 participants 2 messages Oct 14

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

PATCH 1/1 dlm: don't warn when closing a node without a connection

Opening and closing a configfs comm entry without ever configuring an address for it triggers the following warning:

mkdir /sys/kernel/config/dlm/cluster
mkdir /sys/kernel/config/dlm/cluster/comms/1
rmdir /sys/kernel/config/dlm/cluster/comms/1

dlm: closing connection to node 1

  ------------[ cut here ]------------
  !con
  WARNING: fs/dlm/lowcomms.c:1455 at dlm_lowcomms_close+0x12d/0x470, CPU#1

Since commit 6f0b0b5d7ae7 ("fs: dlm: remove dlm_node_addrs lookup list") the lowcomms connection has the same lifetime as the configfs comm entry, but a connection is only created when an address is configured via the addr attribute. Removing a comm entry for which no address was ever set up is valid and the resulting close call has simply nothing to do, so it must not warn.

Reported-by [email protected]
Fixes 6f0b0b5d7ae7 ("fs: dlm: remove dlm_node_addrs lookup list")
---
 fs/dlm/lowcomms.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/dlm/lowcomms.c +5 -1
index 2aff1c7..86c7af9 100644
@@ -1452,7 +1452,11 @@ int dlm_lowcomms_close(int nodeid)
 
 	idx = srcu_read_lock(&connections_srcu);
 	con = nodeid2con(nodeid, 0);
-	if (WARN_ON_ONCE(!con)) {
+	/* case of dlm_midcomms_close() for a node which never had an
+	 * address configured, so no connection was ever created and
+	 * there is nothing to close
+	 */
+	if (!con) {
 		srcu_read_unlock(&connections_srcu, idx);
 		return -ENOENT;
 	}
Signature · 1 line
2.43.0
#1 lore raw
Quoted 19 lines · On Wed, Oct 14, 2026 at 05:02:37PM +0800, vienna-0FFH wrote:

Opening and closing a configfs comm entry without ever configuring an address for it triggers the following warning:

mkdir /sys/kernel/config/dlm/cluster
mkdir /sys/kernel/config/dlm/cluster/comms/1
rmdir /sys/kernel/config/dlm/cluster/comms/1

dlm: closing connection to node 1

  ------------[ cut here ]------------
  !con
  WARNING: fs/dlm/lowcomms.c:1455 at dlm_lowcomms_close+0x12d/0x470, CPU#1

Since commit 6f0b0b5d7ae7 ("fs: dlm: remove dlm_node_addrs lookup list") the lowcomms connection has the same lifetime as the configfs comm entry, but a connection is only created when an address is configured via the addr attribute. Removing a comm entry for which no address was ever set up is valid and the resulting close call has simply nothing to do, so it must not warn.

Quoted 5 lines
Reported-by [email protected]
Fixes 6f0b0b5d7ae7 ("fs: dlm: remove dlm_node_addrs lookup list")

Real name is needed please.

thanks,

greg k-h