fs: dlm: check for pending users filling buffers
authorAlexander Aring <aahringo@redhat.com>
Tue, 30 Nov 2021 19:47:15 +0000 (14:47 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 7 Dec 2021 18:42:26 +0000 (12:42 -0600)
Currently we don't care if the DLM application stack is filling buffers
(not committed yet) while we transmit some already committed buffers.
By checking on active writequeue users before dequeue a writequeue entry
we know there is coming more data and do nothing. We wait until the send
worker will be triggered again if the writequeue entry users hit zero.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c

index f7fc1ac..6d500eb 100644 (file)
@@ -201,7 +201,10 @@ static struct writequeue_entry *con_next_wq(struct connection *con)
 
        e = list_first_entry(&con->writequeue, struct writequeue_entry,
                             list);
-       if (e->len == 0)
+       /* if len is zero nothing is to send, if there are users filling
+        * buffers we wait until the users are done so we can send more.
+        */
+       if (e->users || e->len == 0)
                return NULL;
 
        return e;