• Theodore Ts'o's avatar
    ext4: fix clang build regression · b80b32b6
    Theodore Ts'o authored
    Arnd Bergmann <arnd@arndb.de>
    
    As Stefan pointed out, I misremembered what clang can do specifically,
    and it turns out that the variable-length array at the end of the
    structure did not work (a flexible array would have worked here
    but not solved the problem):
    
    fs/ext4/mballoc.c:2303:17: error: fields must have a constant size:
    'variable length array in structure' extension will never be supported
                    ext4_grpblk_t counters[blocksize_bits + 2];
    
    This reverts part of my previous patch, using a fixed-size array
    again, but keeping the check for the array overflow.
    
    Fixes: 2df2c340 ("ext4: fix warning about stack corruption")
    Reported-by: default avatarStefan Agner <stefan@agner.ch>
    Tested-by: default avatarChandan Rajendra <chandan@linux.vnet.ibm.com>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    b80b32b6
mballoc.c 147 KB