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

add LASSERT and CERROR warnings to checkpatch.pl

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.6.0
    • Lustre 2.6.0
    • 3
    • 13465

    Description

      Add some scanning for new LASSERT()s, LCONSOLE_*()s, and CERROR()s to checkpatch.pl. So that for a change like:

      diff --git a/lustre/llite/file.c b/lustre/llite/file.c
      index e92a510..b0177e3 100644
      --- a/lustre/llite/file.c
      +++ b/lustre/llite/file.c
      @@ -55,8 +55,13 @@ struct ll_file_data *ll_file_data_get(void)
              struct ll_file_data *fd;
       
              OBD_SLAB_ALLOC_PTR_GFP(fd, ll_file_data_slab, GFP_NOFS);
      +
      +       LASSERT(fd != NULL);
      +
      +       CERROR("fd = %p\n", fd);
      +
              if (fd == NULL)
      -               return NULL;
      +               LCONSOLE_ERROR("NULL fd! Add more memory?\n");
       
              fd->fd_write_failed = false;
      

      We get:

      WARNING: try to replace LASSERT() with error handling
      #42: FILE: lustre/llite/file.c:59:
      +	LASSERT(fd != NULL);
      
      WARNING: think hard before adding new CERROR messages
      #44: FILE: lustre/llite/file.c:61:
      +	CERROR("fd = %p\n", fd);
      
      WARNING: avoid adding new console messages
      #48: FILE: lustre/llite/file.c:64:
      +		LCONSOLE_ERROR("NULL fd! Add more memory?\n");
      
      total: 0 errors, 3 warnings, 41 lines checked
      
      Your patch has style problems, please review.
      
      If any of these errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
      

      Attachments

        Issue Links

          Activity

            [LU-4872] add LASSERT and CERROR warnings to checkpatch.pl
            jhammond John Hammond made changes -
            Fix Version/s New: Lustre 2.6.0 [ 10595 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            jlevi Jodi Levi (Inactive) made changes -
            Assignee Original: WC Triage [ wc-triage ] New: John Hammond [ jhammond ]
            jhammond John Hammond added a comment - Please see http://review.whamcloud.com/9914 .
            jhammond John Hammond made changes -
            Link New: This issue is related to LU-1095 [ LU-1095 ]
            jhammond John Hammond created issue -

            People

              jhammond John Hammond
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: