From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Mon, 4 Jan 2021 16:00:20 -0500 Subject: [Cluster-devel] [PATCHv3 dlm/next 16/20] fs: dlm: add per node receive flush In-Reply-To: <20210104210024.233765-1-aahringo@redhat.com> References: <20210104210024.233765-1-aahringo@redhat.com> Message-ID: <20210104210024.233765-17-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 This patch will add a functionality to flush pending dlm messages from the receiving workqueue. Upcoming patches will use it to make sure that nothing can be received e.g. after a node gets removed from the nodes hash. Receiving messages will occur into a node lookup which might create an node for the hash again. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 9 +++++++++ fs/dlm/lowcomms.h | 1 + 2 files changed, 10 insertions(+) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 9a3899ad1765..0e4cbabc680f 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1607,6 +1607,15 @@ static void clean_one_writequeue(struct connection *con) spin_unlock_bh(&con->writequeue_lock); } +void dlm_lowcomms_rx_flush(int nodeid) +{ + struct connection *con; + + con = nodeid2con(nodeid, 0); + if (con) + flush_work(&con->rwork); +} + /* Called from recovery when it knows that a node has left the cluster */ int dlm_lowcomms_close(int nodeid) diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h index 8286531f9a9e..c4c789a68cf6 100644 --- a/fs/dlm/lowcomms.h +++ b/fs/dlm/lowcomms.h @@ -39,6 +39,7 @@ int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr, int len); void dlm_lowcomms_put_buffer(void *mh); void dlm_lowcomms_get_buffer(void *mh); void dlm_lowcomms_resend_buffer(void *mh); +void dlm_lowcomms_rx_flush(int nodeid); #endif /* __LOWCOMMS_DOT_H__ */ -- 2.26.2