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()
            pjones Peter Jones made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
            pjones Peter Jones made changes -
            Resolution Original: Fixed [ 1 ]
            Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.14.0 [ 14490 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            adilger Andreas Dilger made changes -
            Assignee Original: WC Triage [ wc-triage ] New: Arshad Hussain [ arshad512 ]
            adilger Andreas Dilger made changes -
            Description Original: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing, which was added in patch {{v3.8-3205-g9a8ab1c39970}} "{{bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG}}" (i.e. 3.9 kernel).

            *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} 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_MSG()}} 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.
            New: 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.
            adilger Andreas Dilger made changes -
            Summary Original: replace CLASSERT() with BUILD_BUG_ON_MSG() New: replace CLASSERT() with BUILD_BUG_ON()
            simmonsja James A Simmons made changes -
            Link New: This issue is related to LU-9859 [ LU-9859 ]
            adilger Andreas Dilger made changes -
            Description Original: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing, which was added in patch {{v3.8-3205-g9a8ab1c39970}} "{{bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG}}" (i.e. 3.9 kernel).

            *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} 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_MSG()}} 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.
            New: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing, which was added in patch {{v3.8-3205-g9a8ab1c39970}} "{{bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG}}" (i.e. 3.9 kernel).

            *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} 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_MSG()}} 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.
            adilger Andreas Dilger made changes -
            Description Original: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing.

            *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} is verifying if the expression is *false*, so the logic of each check should be reversed.
            New: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing, which was added in patch {{v3.8-3205-g9a8ab1c39970}} "{{bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG}}" (i.e. 3.9 kernel).

            *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} 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_MSG()}} 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.
            adilger Andreas Dilger made changes -
            Description Original: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing. *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} is verifying if the expression is *false*, so the logic of each check should be reversed. New: The Lustre-specific compile-time assertion {{CLASSERT()}} should be replaced with the standard kernel {{BUILD_BUG_ON_MSG()}} macro that does the same thing.

            *NOTE* that the logic of {{CLASSERT()}} is ensuring that the expression is *true* while {{BUILD_BUG_ON_MSG()}} is verifying if the expression is *false*, so the logic of each check should be reversed.
            adilger Andreas Dilger created issue -

            People

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

              Dates

                Created:
                Updated:
                Resolved: