[LU-5774] lu_object_find_at() should NOT test conditional that doesn't change inside a loop Created: 21/Oct/14  Updated: 23/Dec/15  Resolved: 05/Jan/15

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

Type: Improvement Priority: Trivial
Reporter: Isaac Huang (Inactive) Assignee: Isaac Huang (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-5885 LFSCK 3: ‘lctl lfsck_start -t namespa... Resolved
Rank (Obsolete): 16208

 Description   

In lu_object_find_at():

       while (1) {
               if (conf != NULL && conf->loc_flags & LOC_F_NOWAIT) {
                       obj = lu_object_find_try(env, dev, f, conf, NULL);

                       return obj;
        ......
        }

If I haven't missed something, it doesn't make sense to have the 'if' conditional inside the while loop - conf is a const struct lu_object_conf *, i.e. it doesn't change, so the conditional would always evaluate the same.

When I first read the code, I was misled to believe that the conditional may change so it had to be tested at each iteration.



 Comments   
Comment by Isaac Huang (Inactive) [ 21/Oct/14 ]

http://review.whamcloud.com/#/c/12354/

Comment by James A Simmons [ 16/Dec/14 ]

This enhancement was included in the patch http://review.whamcloud.com/#/c/12741 for LU-5885.

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