[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96158847-4F1F-4293-8435-E111F39E3260@zytor.com>
Date: Fri, 17 Mar 2017 13:04:27 -0700
From: hpa@...or.com
To: Peter Zijlstra <peterz@...radead.org>,
Michael Davidson <md@...gle.com>
CC: Alexander Potapenko <glider@...gle.com>,
Michal Marek <mmarek@...e.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Shaohua Li <shli@...nel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Matthias Kaehlcke <mka@...omium.org>, x86@...nel.org,
linux-kbuild@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
linux-crypto@...r.kernel.org, linux-raid@...r.kernel.org
Subject: Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array
On March 17, 2017 12:27:46 PM PDT, Peter Zijlstra <peterz@...radead.org> wrote:
>On Fri, Mar 17, 2017 at 11:52:01AM -0700, Michael Davidson wrote:
>> On Fri, Mar 17, 2017 at 5:44 AM, Peter Zijlstra
><peterz@...radead.org> wrote:
>> >
>> > Be that as it may; what you construct above is disgusting. Surely
>the
>> > code can be refactored to not look like dog vomit?
>> >
>> > Also; its not immediately obvious conf->copies is 'small' and this
>> > doesn't blow up the stack; I feel that deserves a comment
>somewhere.
>> >
>>
>> I agree that the code is horrible.
>>
>> It is, in fact, exactly the same solution that was used to remove
>> variable length arrays in structs from several of the crypto drivers
>a
>> few years ago - see the definition of SHASH_DESC_ON_STACK() in
>> "crypto/hash.h" - I did not, however, hide the horrors in a macro
>> preferring to leave the implementation visible as a warning to
>whoever
>> might touch the code next.
>>
>> I believe that the actual stack usage is exactly the same as it was
>previously.
>>
>> I can certainly wrap this up in a macro and add comments with
>> appropriately dire warnings in it if you feel that is both necessary
>> and sufficient.
>
>We got away with ugly in the past, so we should get to do it again?
Seriously, you should have taken the hack the first time that this needs to be fixed. Just because this is a fairly uncommon construct in the kernel doesn't mean it is not in userspace.
I would like to say this falls in the category of "fix your compiler this time". Once is one thing, twice is unacceptable.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Powered by blists - more mailing lists