All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Ahring Oder Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm-next 2/4] fs: dlm: fix report error of invalid messages
Date: Fri, 24 Jul 2020 10:04:29 -0400	[thread overview]
Message-ID: <CAK-6q+guZeX-S8vwL=2pa+9_LfsQTAuxhtDuOPMd5RSh_X0PWQ@mail.gmail.com> (raw)
In-Reply-To: <20200723144908.271110-3-aahringo@redhat.com>

Hi,

On Thu, Jul 23, 2020 at 10:49 AM Alexander Aring <aahringo@redhat.com> 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 <aahringo@redhat.com>
> ---
>  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



  reply	other threads:[~2020-07-24 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 14:49 [Cluster-devel] [PATCH dlm-next 0/4] fs: dlm: receive handling changes Alexander Aring
2020-07-23 14:49 ` [Cluster-devel] [PATCH dlm-next 1/4] fs: dlm: don't close socket on invalid message Alexander Aring
2020-07-23 14:49 ` [Cluster-devel] [PATCH dlm-next 2/4] fs: dlm: fix report error of invalid messages Alexander Aring
2020-07-24 14:04   ` Alexander Ahring Oder Aring [this message]
2020-07-23 14:49 ` [Cluster-devel] [PATCH dlm-next 3/4] fs: dlm: change handling of reconnects Alexander Aring
2020-07-23 14:49 ` [Cluster-devel] [PATCH dlm-next 4/4] fs: dlm: implement tcp graceful shutdown Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK-6q+guZeX-S8vwL=2pa+9_LfsQTAuxhtDuOPMd5RSh_X0PWQ@mail.gmail.com' \
    --to=aahringo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.