From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Fri, 21 May 2021 15:08:36 -0400 Subject: [Cluster-devel] [PATCHv6 v5.13-rc1 dlm/next 04/16] fs: dlm: set is othercon flag In-Reply-To: <20210521190848.350176-1-aahringo@redhat.com> References: <20210521190848.350176-1-aahringo@redhat.com> Message-ID: <20210521190848.350176-5-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit There is a is othercon flag which is never used, this patch will set it and printout a warning if the othercon ever sends a dlm message which should never be the case. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 7c7a31377f27..4944aef24aa5 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -938,6 +938,7 @@ static int accept_from_sock(struct listen_connection *con) } lockdep_set_subclass(&othercon->sock_mutex, 1); + set_bit(CF_IS_OTHERCON, &othercon->flags); newcon->othercon = othercon; } else { /* close other sock con if we have something new */ @@ -1601,6 +1602,8 @@ static void process_send_sockets(struct work_struct *work) { struct connection *con = container_of(work, struct connection, swork); + WARN_ON(test_bit(CF_IS_OTHERCON, &con->flags)); + clear_bit(CF_WRITE_PENDING, &con->flags); if (con->sock == NULL) /* not mutex protected so check it inside too */ con->connect_action(con); -- 2.26.3