[LU-9834] misleading loop in llapi_layout_test.c test 29 Created: 04/Aug/17  Updated: 29/Jan/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: easy, test

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Smatch highlights:

        for (i = LOV_MAX_STRIPE_COUNT-1; i <= 0; i--) {
                rc = llapi_layout_ost_index_get(layout, i, &ost0);
                ASSERTF(rc == 0, "errno = %d", errno);
                ASSERTF(ost0 == nost, "ost=%"PRIu64", nost=%"PRIu64"",
                        ost0, nost);
                nost++;
                if (nost == num_osts)
                        nost = 0;
        }

Since LOV_MAX_STRIPE_COUNT-1 is always > 0 and the end condition is <= 0 - we never enter this loop.


Generated at Sat Feb 10 02:29:41 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.