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

annotations for sparse static analyzer

Details

    • Bug
    • Resolution: Fixed
    • Trivial
    • Lustre 2.7.0
    • Lustre 2.6.0
    • 3
    • 15020

    Description

      sparse (git://git.kernel.org/pub/scm/devel/sparse/sparse.git) is a static analyzer used in kernel dev. After installing it, it can easily be used with Lustre:

      make C=1
      

      Currently there is about 3900 warnings. Most of it is noise, and a few annotations will silence them. However in that noise, some bugs might be lurking.

      Besides finding bugs, it currently tags 1000 functions that can be made static. Once marked static, that will enable the compiler to optimize them more aggressively, which may lead to some minor performance improvements.

      So far I've cleared about 1000 of them and found only one bug (strcmp with userspace provided buffer in fld_proc_hash_seq_write) and several unused functions.

      Attachments

        Issue Links

          Activity

            [LU-5396] annotations for sparse static analyzer

            Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12207/
            Subject: LU-5396 libcfs: make some functions static
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 336f628d5ea17cb0afe26cd966e333e40755b38b

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12207/ Subject: LU-5396 libcfs: make some functions static Project: fs/lustre-release Branch: master Current Patch Set: Commit: 336f628d5ea17cb0afe26cd966e333e40755b38b
            fzago Frank Zago (Inactive) added a comment - 0 -> NULL: http://review.whamcloud.com/12567
            fzago Frank Zago (Inactive) added a comment - - edited Make some static symbols: http://review.whamcloud.com/12206 http://review.whamcloud.com/12207 http://review.whamcloud.com/12211 http://review.whamcloud.com/12219 http://review.whamcloud.com/12220 http://review.whamcloud.com/12221 http://review.whamcloud.com/12222 http://review.whamcloud.com/12223 Done for this series. There will a new one once this one is integrated.
            pjones Peter Jones added a comment -

            A 1000?! The final straight then

            pjones Peter Jones added a comment - A 1000?! The final straight then

            Hi Peter, there's quite a few more patches to come.

            Number of warnings is down to less to 1000 now.

            fzago Frank Zago (Inactive) added a comment - Hi Peter, there's quite a few more patches to come. Number of warnings is down to less to 1000 now.
            pjones Peter Jones added a comment -

            Frank

            I see that all the present patches tracked under this ticket have landed. Are there more to come or can we now close this ticket?

            Peter

            pjones Peter Jones added a comment - Frank I see that all the present patches tracked under this ticket have landed. Are there more to come or can we now close this ticket? Peter
            fzago Frank Zago (Inactive) added a comment - - edited Add __user annotations (same as above, but 1 patch per branch) http://review.whamcloud.com/11817 (upstream) http://review.whamcloud.com/11818 (upstream) http://review.whamcloud.com/11819 (upstream) http://review.whamcloud.com/11820 (upstream) http://review.whamcloud.com/11821 (upstream) http://review.whamcloud.com/11822 (upstream) http://review.whamcloud.com/11823 (upstream) http://review.whamcloud.com/11824 (upstream)

            Thank you for doing this. A lot of the upstream kernel Lustre client patches are these types of patches. This will help us move closer to the upstream client for style issues much faster.

            simmonsja James A Simmons added a comment - Thank you for doing this. A lot of the upstream kernel Lustre client patches are these types of patches. This will help us move closer to the upstream client for style issues much faster.
            fzago Frank Zago (Inactive) added a comment - - edited

            Add __user annotations.

            http://review.whamcloud.com/11802 (abandoned, see below)
            http://review.whamcloud.com/11803 (abandoned, see below)
            http://review.whamcloud.com/11804 (abandoned, see below)
            http://review.whamcloud.com/11805 (abandoned, see below)
            http://review.whamcloud.com/11806 (abandoned, see below)
            http://review.whamcloud.com/11807 (abandoned, see below)
            http://review.whamcloud.com/11808 (abandoned, see below)
            http://review.whamcloud.com/11809 (abandoned, see below)
            http://review.whamcloud.com/11810 (abandoned, see below)

            fzago Frank Zago (Inactive) added a comment - - edited Add __user annotations. http://review.whamcloud.com/11802 (abandoned, see below) http://review.whamcloud.com/11803 (abandoned, see below) http://review.whamcloud.com/11804 (abandoned, see below) http://review.whamcloud.com/11805 (abandoned, see below) http://review.whamcloud.com/11806 (abandoned, see below) http://review.whamcloud.com/11807 (abandoned, see below) http://review.whamcloud.com/11808 (abandoned, see below) http://review.whamcloud.com/11809 (abandoned, see below) http://review.whamcloud.com/11810 (abandoned, see below)
            fzago Frank Zago (Inactive) added a comment - - edited Made some functions static: http://review.whamcloud.com/11305 (upstream) http://review.whamcloud.com/11306 http://review.whamcloud.com/11255 (upstream) http://review.whamcloud.com/11256 (upstream)
            fzago Frank Zago (Inactive) added a comment - - edited Locking annotations: http://review.whamcloud.com/11481 (upstream) http://review.whamcloud.com/11294 (upstream) http://review.whamcloud.com/11295

            People

              dmiter Dmitry Eremin (Inactive)
              fzago Frank Zago (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: