Skip to content

Commit e61113c

Browse files
Alexander Aringteigland
authored andcommitted
dlm: init per node debugfs before add to node hash
Avoiding potential issues when a node is added to the hash but the debugfs is not NULL or IS_ERR() so a potential iteration over the hash and debugfs_remove() will not fail like in dlm_midcomms_exit(). However dlm_midcomms_exit() will be called in module init/exit function and the hash should be empty anyway at those stages. We change the behavior as cleanup to avoid potential issues. Reported-by: Ginger <ginger.jzllee@gmail.com> Closes: https://lore.kernel.org/gfs2/CAGp+u1ZE7UsQ4sSUHBKQXU8x3M_jwK=ek1urSjEtd3jXQGFmVg@mail.gmail.com Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent d2248cb commit e61113c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/dlm/midcomms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr)
356356
if (!node)
357357
return -ENOMEM;
358358

359+
node->debugfs = dlm_create_debug_comms_file(nodeid, node);
359360
node->nodeid = nodeid;
360361
spin_lock_init(&node->state_lock);
361362
spin_lock_init(&node->send_queue_lock);
@@ -369,7 +370,6 @@ int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr)
369370
hlist_add_head_rcu(&node->hlist, &node_hash[r]);
370371
spin_unlock_bh(&nodes_lock);
371372

372-
node->debugfs = dlm_create_debug_comms_file(nodeid, node);
373373
return 0;
374374
}
375375

0 commit comments

Comments
 (0)