SCIENTIFIC-LINUX-USERS Archives

August 2018

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
David Sommerseth <[log in to unmask]>
Reply To:
Date:
Wed, 22 Aug 2018 16:52:19 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
On 21/08/18 18:15, Akemi Yagi wrote:
> On Sat, Aug 18, 2018 at 5:41 PM Akemi Yagi <[log in to unmask]> wrote:
>>
>> On Sat, Aug 18, 2018 at 2:57 PM, Akemi Yagi <[log in to unmask]> wrote:
> 
>>> And hopefully RH updates the bug status in their solution article at:
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__access.redhat.com_solutions_3568891&d=DwIBaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=gd8BzeSQcySVxr0gDWSEbN-P-pgDXkdyCtaMqdCgPPdW1cyL5RIpaIYrCn8C5x2A&m=rJMdgZ0Kf_AH_lMllo2MzJnOwzhl84Oc3RhV39JtSb4&s=vcuLkDj0mL4CHeXUYPeYYyGndQGWmz0paMyxB51yCAg&e=
>>> "Infiniband card fails to initialize after kernel update in RHEL 7.5"
>>>
>>> Akemi
>>
>> There is a bug report with patch candidates at bugs.centos.org :
>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.centos.org_view.php-3Fid-3D15193&d=DwIBaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=gd8BzeSQcySVxr0gDWSEbN-P-pgDXkdyCtaMqdCgPPdW1cyL5RIpaIYrCn8C5x2A&m=rJMdgZ0Kf_AH_lMllo2MzJnOwzhl84Oc3RhV39JtSb4&s=3FuS_In9whmlhdZjbNN_oRe9MgHanG3v22atqqQJHaQ&e=
>>
>> Akemi
> 
> Amazingly this rather serious bug was caused by a "mishap" in the source code:
> 
> if (!rdma_is_port_valid_nospec(device, &ah_attr->port_num));
> [Note the semicolon at the end]

This is exactly why many developers insist on using {} regardless if it
is a single line being executed or not after the if() statement.

   if (....)
   {
       // some code
   }

Then you can have simple code analysers complaining if a ')' isn't followed
by a '{', which is a fairly simple rule to configure (even some clever regexp
can catch that) ... Plus those {} will also protect you against similar
variants, such as:

   if (....)
       call_some_func();
       call_some_other_func();

   should_always_be_called();

... but the kernel coding styles still doesn't account for these scenarios, so
this will hit again - sooner or later :(


-- 
kind regards,

David Sommerseth

ATOM RSS1 RSS2