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

suspicious else statement in lfsck_del_target()

    XMLWordPrintable

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

          People

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

            Dates

              Created:
              Updated:
              Resolved: