Bug 1464418 - tcmu-runner: fix pthread_*() return value checks
Summary: tcmu-runner: fix pthread_*() return value checks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: tcmu-runner
Version: rhgs-3.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHGS 3.3.0
Assignee: Prasanna Kumar Kalever
QA Contact: Sweta Anandpara
URL:
Whiteboard: 3.3.0-devel-freeze-exception
Depends On:
Blocks: 1417151
TreeView+ depends on / blocked
 
Reported: 2017-06-23 11:48 UTC by Prasanna Kumar Kalever
Modified: 2017-09-21 04:20 UTC (History)
6 users (show)

Fixed In Version: tcmu-runner-1.2.0-7.el7rhgs
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-21 04:20:54 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2773 0 normal SHIPPED_LIVE new packages: gluster-block 2017-09-21 08:16:22 UTC

Description Prasanna Kumar Kalever 2017-06-23 11:48:30 UTC
Description of problem:
In tcmu-runner currently most of the pthread_*() functions return value checks looks like

ret = pthread_mutex_init(&lock, NULL);
if (ret < 0) {
   ...
}

Which is wrong, and this is practiced almost every where they are used. Which could result in unknown behaviors.

Fix:
Summary of manual pages of all pthread_*() functions,
On success, pthread_*() returns 0; on error, they returns an error number

ret = pthread_mutex_init(&lock, NULL);
if (ret != 0) {
    ... That magic ...
}

Comment 7 Sweta Anandpara 2017-07-14 06:14:29 UTC
Prasanna, Please refer comment6.

Comment 10 Sweta Anandpara 2017-07-18 06:53:49 UTC
A round of testing has been done on glusterfs-3.8.4-33 and gluster-block-0.2.1-6. No crashes/issues have been seen, nor are there any unexpected error messages present in the logs. 

Based on comment 8 and 9, with the developer's and release leads' aggreeement, moving this bug to (conditionally) verified.

Comment 13 errata-xmlrpc 2017-09-21 04:20:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:2773


Note You need to log in before you can comment on or make changes to this bug.