Details

    • Technical task
    • Resolution: Fixed
    • Minor
    • Lustre 2.14.0
    • Lustre 2.14.0
    • 9223372036854775807

    Description

      The Lustre-specific compile-time assertion CLASSERT() should be replaced with the standard kernel BUILD_BUG_ON() macro that does the same thing.

      NOTE that the logic of CLASSERT() is ensuring that the expression is true while BUILD_BUG_ON() is verifying if the expression is false, so the logic of each check should be reversed.

      All of these expressions are evaluated at compile time, so it is possible to mark all patches fixing this with Test-Parameters: trivial.

      The first patch in the series should update contrib/scripts/spelling.txt to add CLASSERT||BUILD_BUG_ON() so that new patches get a warning if they are using the old CLASSERT() macro. The last patch in the series should remove the CLASSERT() macro. There are currently 480 instances of CLASSERT() in the master branch, but a majority of them (318) are in the automatically-generated wirecheck.c, pack-generic.c and api-ni.c file, so most could be easily replaced by fixing the wiretest.c scripts.

      Attachments

        Issue Links

          Activity

            [LU-12923] replace CLASSERT() with BUILD_BUG_ON()

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36902/
            Subject: LU-12923 libcfs: Use BUILD_BUG_ON() for hash.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: eb3d0504f2d7eed8c8c584af82ad609455071bd2

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36902/ Subject: LU-12923 libcfs: Use BUILD_BUG_ON() for hash.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: eb3d0504f2d7eed8c8c584af82ad609455071bd2

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36711/
            Subject: LU-12923 utils: Use BUILD_BUG_ON() for wirehdr.c & wirecheck.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 5a3f9f4cc3c31b0f521932df80a9ac541edec073

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36711/ Subject: LU-12923 utils: Use BUILD_BUG_ON() for wirehdr.c & wirecheck.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: 5a3f9f4cc3c31b0f521932df80a9ac541edec073

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36725/
            Subject: LU-12923 lustre: Replace CLASSERT() with BUILD_BUG_ON()
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 6c6ca1fbfb1b2be0e6a9675f9214f98e59bc8088

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36725/ Subject: LU-12923 lustre: Replace CLASSERT() with BUILD_BUG_ON() Project: fs/lustre-release Branch: master Current Patch Set: Commit: 6c6ca1fbfb1b2be0e6a9675f9214f98e59bc8088

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36649/
            Subject: LU-12923 ptlrpc: Use BUILD_BUG_ON() for pack_generic.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: a1bf9876a328aec3b1d307e8b20d997b30377402

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36649/ Subject: LU-12923 ptlrpc: Use BUILD_BUG_ON() for pack_generic.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: a1bf9876a328aec3b1d307e8b20d997b30377402

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36722/
            Subject: LU-12923 mdc: Use BUILD_BUG_ON() for mdc_request.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: f4408ad5377a104aae869ef8bf02796fdfa8fb79

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36722/ Subject: LU-12923 mdc: Use BUILD_BUG_ON() for mdc_request.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: f4408ad5377a104aae869ef8bf02796fdfa8fb79

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36721/
            Subject: LU-12923 target: Use BUILD_BUG_ON() for tgt_lastrcvd.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 8bbc27d31389cabe992d68dd9b0900bb26971e66

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36721/ Subject: LU-12923 target: Use BUILD_BUG_ON() for tgt_lastrcvd.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: 8bbc27d31389cabe992d68dd9b0900bb26971e66

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36720/
            Subject: LU-12923 ldlm: Use BUILD_BUG_ON() for ldlm_resource.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: db25e324ad6b59b75db001a4f86d8467bed81ad2

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36720/ Subject: LU-12923 ldlm: Use BUILD_BUG_ON() for ldlm_resource.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: db25e324ad6b59b75db001a4f86d8467bed81ad2

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36719/
            Subject: LU-12923 mdd: Use BUILD_BUG_ON() for mdd_object.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 0978020c92f0b2b623f12cf2e5c9a9e0e7fc6411

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36719/ Subject: LU-12923 mdd: Use BUILD_BUG_ON() for mdd_object.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: 0978020c92f0b2b623f12cf2e5c9a9e0e7fc6411

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36718/
            Subject: LU-12923 lov: Use BUILD_BUG_ON() for lov_pack.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: f6b5483170a3d729d1163a0d6a0da63c6ba926fe

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36718/ Subject: LU-12923 lov: Use BUILD_BUG_ON() for lov_pack.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: f6b5483170a3d729d1163a0d6a0da63c6ba926fe

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36717/
            Subject: LU-12923 mdc: Use BUILD_BUG_ON() for mdc_reint.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 9b9903816c96c87685273bbdb3aa3853666a37de

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36717/ Subject: LU-12923 mdc: Use BUILD_BUG_ON() for mdc_reint.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: 9b9903816c96c87685273bbdb3aa3853666a37de

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36648/
            Subject: LU-12923 pltrpc: Use BUILD_BUG_ON() for wiretest.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: e2126c7858da90a233b08baa10917e71a72fc6b7

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36648/ Subject: LU-12923 pltrpc: Use BUILD_BUG_ON() for wiretest.c Project: fs/lustre-release Branch: master Current Patch Set: Commit: e2126c7858da90a233b08baa10917e71a72fc6b7

            People

              arshad512 Arshad Hussain
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: