lkml.org 
[lkml]   [2020]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] checkpatch: add --max-file-size option
From
Date
On Wed, 2020-06-10 at 13:56 -0700, Scott Branden wrote:
> Add --max-file-size option (default off) to limit size of files
> that checkpatch processes. Such an option is useful when checkpatch
> is run automatically during checkins to a source control system and
> someone acccidently or purposely attempt to commit massive size files
> to the system. If the checkpatch script runs on such files it could take
> a long time to run and limit the server's ability to perform other
> operations.

Does everything need to be in checkpatch or can this facility
be run by a separate script that does the file size validation
before running checkpatch?

Also:

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> + if ($max_file_size > 0) {
> + my $filesize = -s$FILE;

Does this work if the input file is from STDIN?
I'd guess it does not.

I think this might be better using (stat($FILE))[7]
or at least a space between -s and $file.


\
 
 \ /
  Last update: 2020-06-10 23:08    [W:0.038 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site