Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5466

suspicious else statement in lfsck_del_target()

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.7.0
    • Lustre 2.7.0
    • 3
    • 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
      
      

      Attachments

        Activity

          [LU-5466] suspicious else statement in lfsck_del_target()

          The patch has been landed to master.

          yong.fan nasf (Inactive) added a comment - The patch has been landed to master.
          yong.fan nasf (Inactive) added a comment - Here is the patch: http://review.whamcloud.com/11407

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

          jlevi Jodi Levi (Inactive) added a comment - Fan Yong, Can you please comment on this one? Thank you!
          rread Robert Read added a comment -

          That reminds me of something...

          rread Robert Read added a comment - That reminds me of something...

          People

            yong.fan nasf (Inactive)
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: