Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603617

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

From hpa@zytor.com
Newsgroups linux.kernel
Subject Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array
Date 2017-03-17 21:50 +0100
Message-ID <tm6YV-3Hs-13@gated-at.bofh.it> (permalink)
References (2 earlier) <tlZ1o-6iZ-29@gated-at.bofh.it> <tlZkK-6pR-11@gated-at.bofh.it> <tlZup-6vs-7@gated-at.bofh.it> <tm5Jw-2QT-7@gated-at.bofh.it> <tm6md-3nM-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On March 17, 2017 12:27:46 PM PDT, Peter Zijlstra <peterz@infradead.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@infradead.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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 6/7] md/raid10, LLVM: get rid of variable length array Michael Davidson <md@google.com> - 2017-03-17 01:30 +0100
  Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 13:20 +0100
    Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Alexander Potapenko <glider@google.com> - 2017-03-17 13:40 +0100
      Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 13:50 +0100
        Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Michael Davidson <md@google.com> - 2017-03-17 20:30 +0100
          Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 21:10 +0100
            Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array hpa@zytor.com - 2017-03-17 21:50 +0100
              Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 14:50 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-24 15:20 +0100
      Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Alexander Potapenko <glider@google.com> - 2017-03-17 13:50 +0100
        Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Borislav Petkov <bp@alien8.de> - 2017-03-17 19:10 +0100
          Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-17 19:50 +0100
            Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Borislav Petkov <bp@alien8.de> - 2017-03-17 20:10 +0100
              Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-17 20:10 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 20:40 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 15:00 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-24 15:20 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 15:30 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 21:40 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Fengguang Wu <fengguang.wu@intel.com> - 2017-03-18 01:50 +0100

csiph-web