All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Skists <j.skists@gmail.com>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH] staging: lustre: lnet: use correct 'magic' test
Date: Wed, 21 Mar 2018 19:53:09 +0000	[thread overview]
Message-ID: <20180321195302.GA9465@tanglefoot> (raw)

Use the lnet_magic_accept() function to compare 'magic' against
LNET_PROTO_TCP_MAGIC for the appropriate string for an error message.

The original fix removed an unneeded byte-ordering cast because the define
was already CPU byte-ordered and it was assumed that 'magic' was CPU
byte-ordered, too.

Now modify the if-statement to use the appropriate lnet_accept_magic()
function in order to be consistent with similar tests. This will allow
the code to be consistent with the general understanding that 'magic'
should be in host-byte-order for the peer that sent the message.

Fixes: 80782927e3aa ("staging: lustre: Fix unneeded byte-ordering cast")
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Justin Skists <j.skists@gmail.com>
---
 drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 13e981781b9a..5648f17eddc0 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -240,7 +240,7 @@ lnet_accept(struct socket *sock, __u32 magic)
 			return -EPROTO;
 		}
 
-		if (magic == LNET_PROTO_TCP_MAGIC)
+		if (lnet_accept_magic(magic, LNET_PROTO_TCP_MAGIC))
 			str = "'old' socknal/tcpnal";
 		else
 			str = "unrecognised";
-- 
2.16.2

             reply	other threads:[~2018-03-21 19:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 19:53 Justin Skists [this message]
2018-03-21 23:40 ` [lustre-devel] [PATCH] staging: lustre: lnet: use correct 'magic' test NeilBrown
2018-03-23  5:54 ` Doug Oucharek

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=20180321195302.GA9465@tanglefoot \
    --to=j.skists@gmail.com \
    --cc=lustre-devel@lists.lustre.org \
    /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.