[LU-5466] suspicious else statement in lfsck_del_target() Created: 08/Aug/14  Updated: 25/Aug/14  Resolved: 25/Aug/14

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

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: nasf (Inactive)
Resolution: Fixed Votes: 0
Labels: lfsck

Severity: 3
Rank (Obsolete): 15225

 Description   
@@ -2684,10 +2684,6 @@ void lfsck_del_target(const struct lu_en

 unlock:
        if (ltd == NULL) {
*               if (for_ost)
*                       head = &lfsck->li_ost_descs.ltd_orphan;
*               else
*                       head = &lfsck->li_ost_descs.ltd_orphan;

                list_for_each_entry(ltd, head, ltd_orphan_list) {
                        if (ltd->ltd_tgt == tgt) {

Found by the coccinelle script:

// If branch and else branch have same statement.
// Based on a coverity check mentioned in a blog post by Dave Jones.

@@
statement S;
@@

* if (...) S else S



 Comments   
Comment by Robert Read (Inactive) [ 08/Aug/14 ]

That reminds me of something...

Comment by Jodi Levi (Inactive) [ 11/Aug/14 ]

Fan Yong,
Can you please comment on this one?
Thank you!

Comment by nasf (Inactive) [ 12/Aug/14 ]

Here is the patch:

http://review.whamcloud.com/11407

Comment by nasf (Inactive) [ 25/Aug/14 ]

The patch has been landed to master.

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