[LU-4187] unstable code in lov_unpackmd Created: 30/Oct/13  Updated: 05/Jun/15  Resolved: 02/Dec/13

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

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-2753 Tracking bug for static code analysis... Resolved
Severity: 3
Rank (Obsolete): 11327

 Description   

Playing with the stack tool for detecting unstable code (http://css.csail.mit.edu/stack/) I uncovered this gem:

        if (*lsmp && !lmm) {
                lov_free_memmd(lsmp);
                RETURN(0);
        }

        pattern = le32_to_cpu(lmm->lmm_pattern); <<-- *dereferencing lmm*
        lsm_size = lov_alloc_memmd(lsmp, stripe_count, pattern, magic);
        if (lsm_size < 0)
                RETURN(lsm_size);

        /* If we are passed a pointer but nothing to unpack, we only alloc */
        if (!lmm) <<--  *Now we make sure it's not NULL?*
                RETURN(lsm_size);

After further looking, it appears that the lmm is never passed in as NULL, which ould allow us the opportunity to further simplify this I guess.



 Comments   
Comment by Oleg Drokin [ 02/Dec/13 ]

patch from http://review.whamcloud.com/#/c/7827 fixed the issue

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