From: Eric Ren Date: Wed, 26 Oct 2016 13:59:39 +0800 Subject: [Cluster-devel] [PATCH -next] dlm: fix error return code in sctp_accept_from_sock() In-Reply-To: <6AADFAC011213A4C87B956458587ADB46E0144@SZXEMI508-MBX.china.huawei.com> References: <1477147056-2681-1-git-send-email-weiyj.lk@gmail.com> <6AADFAC011213A4C87B956458587ADB46E0144@SZXEMI508-MBX.china.huawei.com> Message-ID: <3285a25e-8cc4-06fd-b946-abe35365c1ba@suse.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On 10/25/2016 01:03 PM, weiyongjun (A) wrote: > Hi Eric, > >> -----Original Message----- >> From: Eric Ren [mailto:zren at suse.com] >> Sent: Tuesday, October 25, 2016 10:52 AM >> To: Wei Yongjun ; Christine Caulfield >> ; David Teigland ; cluster- >> devel at redhat.com; weiyongjun (A) >> Subject: Re: [Cluster-devel] [PATCH -next] dlm: fix error return code in >> sctp_accept_from_sock() >> >> Hi, >> >> Coding style patch is always rejected;-) > > Are you sure this is a coding style patch? > > This patch fix the issue when addr_to_nodeid() failed, sctp_accept_from_sock() > still return success, not error. Oh sorry, I'm wrong. Then, Reviewed-by: Eric Ren Eric > > But if the patch is useless, please ignore it. > > Regards > Yongjun Wei >> Eric >> On 10/22/2016 10:37 PM, Wei Yongjun wrote: >>> From: Wei Yongjun >>> >>> Fix to return a negative error code from the error handling >>> case instead of 0, as done elsewhere in this function. >>> >>> Signed-off-by: Wei Yongjun >>> --- >>> fs/dlm/lowcomms.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c >>> index df680a2..7d398d3 100644 >>> --- a/fs/dlm/lowcomms.c >>> +++ b/fs/dlm/lowcomms.c >>> @@ -879,7 +879,8 @@ static int sctp_accept_from_sock(struct connection >> *con) >>> } >>> >>> make_sockaddr(&prim.ssp_addr, 0, &addr_len); >>> - if (addr_to_nodeid(&prim.ssp_addr, &nodeid)) { >>> + ret = addr_to_nodeid(&prim.ssp_addr, &nodeid); >>> + if (ret) { >>> unsigned char *b = (unsigned char *)&prim.ssp_addr; >>> >>> log_print("reject connect from unknown addr"); >>> >>> >>> >>> >