[LU-5352] bad if condition in dt_index_read() Created: 15/Jul/14  Updated: 14/Jun/18  Resolved: 30/Oct/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0, Lustre 2.7.0
Fix Version/s: Lustre 2.7.0

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 14923

 Description   

In dt_index_read() we test to if the unsigned int rdpg->rp_count is <= 0 and a multiple of LU_PAGE_SIZE:

        /* rp_count shouldn't be null and should be a multiple of the container           
         * size */
        if (rdpg->rp_count <= 0 && (rdpg->rp_count & (LU_PAGE_SIZE - 1)) != 0)
                RETURN(-EFAULT);

The '&&' should be '||'.

This was found using the clang analyzer.



 Comments   
Comment by John Hammond [ 16/Jul/14 ]

Please see http://review.whamcloud.com/11121.

Comment by Jodi Levi (Inactive) [ 30/Oct/14 ]

Patch landed to Master.

Generated at Sat Feb 10 01:50:45 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.