From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Ahring Oder Aring Date: Fri, 24 Jul 2020 10:04:29 -0400 Subject: [Cluster-devel] [PATCH dlm-next 2/4] fs: dlm: fix report error of invalid messages In-Reply-To: <20200723144908.271110-3-aahringo@redhat.com> References: <20200723144908.271110-1-aahringo@redhat.com> <20200723144908.271110-3-aahringo@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On Thu, Jul 23, 2020 at 10:49 AM Alexander Aring wrote: > > This patch fix the error reporting of invalid messages, the return value > of -EBADMSG is never returned by dlm_process_incoming_buffer(), so we > just check for negative return values. > > Signed-off-by: Alexander Aring > --- > fs/dlm/lowcomms.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c > index ec7ed228a9843..19b50d69babef 100644 > --- a/fs/dlm/lowcomms.c > +++ b/fs/dlm/lowcomms.c > @@ -685,9 +685,9 @@ static int receive_from_sock(struct connection *con) > page_address(con->rx_page), > con->cb.base, con->cb.len, > PAGE_SIZE); > - if (ret == -EBADMSG) { > - log_print("lowcomms: addr=%p, base=%u, len=%u, read=%d", > - page_address(con->rx_page), con->cb.base, > + if (ret < 0) { > + log_print("lowcomms err %d: addr=%p, base=%u, len=%u, read=%d", > + ret, page_address(con->rx_page), con->cb.base, > con->cb.len, r); > } > cbuf_eat(&con->cb, ret); found a problem here. This should be in an else branch of the condition above. In case of ret < 0 we should call "cbuf_eat(&con->cb, r);". I believe... I will send a v2. - Alex