From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD167C33C9E for ; Thu, 30 Jan 2020 04:04:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80DD8206F0 for ; Thu, 30 Jan 2020 04:04:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="2CM33z3Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbgA3EEM (ORCPT ); Wed, 29 Jan 2020 23:04:12 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46567 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbgA3EEM (ORCPT ); Wed, 29 Jan 2020 23:04:12 -0500 Received: by mail-pf1-f193.google.com with SMTP id k29so766459pfp.13 for ; Wed, 29 Jan 2020 20:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pvvVT/b95UaLpYd8lIo04uOv4SDYk7PHg7fzm5Afymw=; b=2CM33z3QmNsLGizAUud8ZrRtcS/UOJVh5srO6r0beE7dVVirSjyUJu5uQbG3wAp+1j igd5VCWO6Rh8WcpPgbCzn/iOdFGAqmclnWh0idY9BDEcZvb8O3xACKrJcCrO0OHWMdcq x0gzeZkIYTrIil50MthvcQxlBLvgEaiZS/6VnOfXiADJd/0akppJPB9uEdD6YU2+No8q w/F5aHJsL9e9kGlTGyHtzjzKWqzEdgL1BL/EeyQoGS/lINLfuj0gi33Eyanul2MMl7Dj JIiHVq9Mj5pq+/+5Zh8f3kdl7zJjHAOgGykuowufHJNu87NGEweXdXwHyyMDxiOQI3lb oBbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pvvVT/b95UaLpYd8lIo04uOv4SDYk7PHg7fzm5Afymw=; b=VbesGvRcxPRXr8d/Dl4hB9tlt6u3l65HT6FqxExj82ERMKY61wivJlDamRL1UvwsT5 tpetz+o7toKx5HHaGcvN3Ib78N1izvhNEMO/N8g7eJ5Gf5wjzcvLp90ExoBFAFw4zFXH oN674fsjlV7BO3aVAemNnij1jqEsFct0bEo338Xn2+Iq/Z0r+j5dW/xqNeLmi36/p/4o Kykt1q70w/C3LtkQAeTdT8wOjxT76e0EVweJx+dgS/n1tJylCKx9YFNeBTYXUGO53RuI IHaF9j5SSsFot7CnMmKvii0T0CYgWy9nHu7o/2k1NYq0qZqgzG1kofzTscvMlrVI+Kth Ov8Q== X-Gm-Message-State: APjAAAUmInUwRe4LstLI1h0rfm7CTx1WdZ4BHX9aoRpz0w4QoBHpE4/m ItBUs73bQgfgS6ZrpBiPDIUt1wbRrpc= X-Google-Smtp-Source: APXvYqyYGaaUNWka3uFLfMuBa+lGiX1WFHjW2SY2k8buO6fFUnR0D0ORcRdfeZ5QHe0LDpgZX/ZFlA== X-Received: by 2002:a63:78c:: with SMTP id 134mr2473976pgh.279.1580357051523; Wed, 29 Jan 2020 20:04:11 -0800 (PST) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id j17sm4483515pfa.28.2020.01.29.20.04.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jan 2020 20:04:11 -0800 (PST) Subject: Re: [PATCH] drbd fifo_alloc: use struct_size To: Stephen Kitt , Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200124200307.1808593-1-steve@sk2.org> From: Jens Axboe Message-ID: Date: Wed, 29 Jan 2020 21:04:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200124200307.1808593-1-steve@sk2.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/24/20 1:03 PM, Stephen Kitt wrote: > Switching to struct_size for the allocation in fifo_alloc avoids > hard-coding the type of fifo_buffer.values in fifo_alloc. It also > provides overflow protection; to avoid pessimistic code being > generated by the compiler as a result, this patch also switches > fifo_size to unsigned, propagating the change as appropriate. Applied, thanks. -- Jens Axboe