[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fe98c147136c5625641d14bf70b13ffbfaeb025a.camel@perches.com>
Date: Wed, 10 Jun 2020 14:08:21 -0700
From: Joe Perches <joe@...ches.com>
To: Scott Branden <scott.branden@...adcom.com>,
Andy Whitcroft <apw@...onical.com>
Cc: BCM Kernel Feedback <bcm-kernel-feedback-list@...adcom.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: add --max-file-size option
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.
Powered by blists - more mailing lists