Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2070667lqp; Tue, 16 Apr 2024 06:42:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuEWRjB9oxB7iQY8hvyoCW2CRaUt91mgb3PaRHcdlf6UORbk0jxc8M/ULJos+s3qDJchU2+z3LxMKlr6qxBjKfZVVBobRtTUAO+G/Sag== X-Google-Smtp-Source: AGHT+IHbqg04sa2b8t0/PVmgVuASwbmnupdU0bHXbMBFD9fDtpzhxRLlngAGG2M+iPckKQTq8eUM X-Received: by 2002:ae9:e515:0:b0:78d:6791:34d1 with SMTP id w21-20020ae9e515000000b0078d679134d1mr13468109qkf.9.1713274949307; Tue, 16 Apr 2024 06:42:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713274949; cv=pass; d=google.com; s=arc-20160816; b=uliMz7pu5wEjQwkzafiN0kMnHaL3NFT9a9TrjMFWznPr38jFxwJqALZDooFLdgBPnT QcI3RVG7s1TBWOWdOM1hVRLzr8k2HAhJelkyuhS0rr2aHEYqhoiE+1Q5MUcyXAGQ9IIr BR4tOC9kSvmH4DpS+T9JueCx+tg1lDTyWhkMk6AesKQ6E1QO5VQa0q0v/3/rjCME9/fi lcg5l+aGF6H2Cb/e8hK7ZOBT0sthRgekVA0ftccYg+qokSO5FH8bn3Vt54E/TerXVzGs ZNp+mCwKtdnJ5YLtkWtvEkM7/WoreQGuYjDuItGqFe6rc5eCHP9ow2xFop7nUfp0b2Yq OpqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=FtRpYGlIaOwBawcvab5vfBiUnObfRbuDvN6mQAPgWkQ=; fh=bb8ezIqALrdBQNsDvmM9PL+JF8AKU3wc14PIInoePlw=; b=Cx5TgST1txNT5eQ35NULiFUa4VRnsB4s9t5w8ofCpd2WsdyulgYoMmcXAEgAMc+gpK 1iZE68M0FMkeFsa5h7fwgKXnXUQFEy98FxB2R7MUge49qq/C2SDyeHw53BLxOlVmZ8tD Fq62B+B77bU4w33BpVIw8TSrTyXqZ29pupe2K0IVWpgMbmg/3RzCR0odq5BosXP04RPn 9o8ewCSUBb8L9seOvGTh3c57dtzioOY/dra0a+AS1MAjBnCVQvl9q9vJfKXUdz5EQYtb 2qvPhKJ2ToskQKu22mcKOykUi+KCk+LREwqmdw6JBvFnImmTRK7bhkd+w3SktLeLH4MQ FjjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linbit-com.20230601.gappssmtp.com header.s=20230601 header.b=xxXbc8FZ; arc=pass (i=1 spf=pass spfdomain=linbit.com dkim=pass dkdomain=linbit-com.20230601.gappssmtp.com dmarc=pass fromdomain=linbit.com); spf=pass (google.com: domain of linux-kernel+bounces-146903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linbit.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c6-20020a05620a200600b0078da0a01a91si12125936qka.610.2024.04.16.06.42.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 06:42:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linbit-com.20230601.gappssmtp.com header.s=20230601 header.b=xxXbc8FZ; arc=pass (i=1 spf=pass spfdomain=linbit.com dkim=pass dkdomain=linbit-com.20230601.gappssmtp.com dmarc=pass fromdomain=linbit.com); spf=pass (google.com: domain of linux-kernel+bounces-146903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linbit.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B98061C20DF3 for ; Tue, 16 Apr 2024 13:42:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23EF712C52E; Tue, 16 Apr 2024 13:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linbit-com.20230601.gappssmtp.com header.i=@linbit-com.20230601.gappssmtp.com header.b="xxXbc8FZ" Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6C3912BF24 for ; Tue, 16 Apr 2024 13:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713274944; cv=none; b=rD3RqCAS5AbQJHS67/nzU6G5CUkrZTV0CkCuAwELDq7Mb225RhXgyX6yxkPLwgTUombbFqwikM35TDTomWD6VYwD25SASPmmRjt9ZwyfiF15KjQG5FVA34C3k5PySL1B2o2IX3S+i8Yj8DVqYl6joix7JRKuCCN6pLUr58w1sH4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713274944; c=relaxed/simple; bh=kMawcbH4oJcmg+k/XZ5/mwGrqYfRcibfiUF4gzIlwNs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n7h2rRd7enK0/5X7PxLhw2fAB1W6zA6SqVPtE1W2qfbvemueW10NpXK4piZFWCb/aNPPOL9Nl73ef5iN1hB7TLkCp7Y1qcQEOdHIqP7uWiZLaLkUZtRTCEPDAQ0Ue/EOIZUNRJDOphMjsfKik4wq6a5UKV7r35tuf3XifOydj/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linbit.com; spf=pass smtp.mailfrom=linbit.com; dkim=pass (2048-bit key) header.d=linbit-com.20230601.gappssmtp.com header.i=@linbit-com.20230601.gappssmtp.com header.b=xxXbc8FZ; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linbit.com Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-343c7fae6e4so3645717f8f.1 for ; Tue, 16 Apr 2024 06:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20230601.gappssmtp.com; s=20230601; t=1713274940; x=1713879740; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=FtRpYGlIaOwBawcvab5vfBiUnObfRbuDvN6mQAPgWkQ=; b=xxXbc8FZGpxwMp+36f5dy8xcMF92xssyK7CxJqFuXiBm85Nrrnd9BCWTac0Ts3X9UV oCC7j3Go98viNXrROs8DtSsxvySQ50nI6RvASVZJK1c4L3AugMHrI8scCkJQDOAMbCWY dfT7L5PKhpPz90picilWFpSSSMbikh5OAdgIwgks8Eylda7xiI/46ha2OsS5gA7kTk7j rio1cR5YDw7MZK6bOm8nfPOKmNLHC63zvS0SNi1XVM56BRKOy36XqxSGtGGo5CY3D1t5 EuHqY6BBNxuszmvOb7TRHqKtPZlCwBnoNunfj+lhi/sO+hvV7u6B2ZtIuvi6iNODrX2X /K/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713274940; x=1713879740; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FtRpYGlIaOwBawcvab5vfBiUnObfRbuDvN6mQAPgWkQ=; b=oIkW3HSIvcS8L7htFRXg+YKcMfqY86FN8hWsD8RkySsdmuLzcYCFdd3x8C3+yBR55C 0OPdwQTKZz6Z7XY1EqwsQRQis88zv3CQu3nw05RPz3KNb9r5v/uDXJ8DKlGHaGD4cXxI ML3iiLlDGGr/hui9lazlxGEt/Wz4s2l0ibATSaFBZrSdVLwGpD64scWS8LhwzzZuxCqX eR7dXfxLdFO/pSy1k6BtCvz47ZvihVKnoXOmOO4Io4JTcyFUGsWWuSGgsPSH9oOMW2v0 GugRvRcPAXISAE3TqS9cikR/jhTAHG2LZHeJ2zqzlU6jGZzPld6t1aA8HADJdQ7b+txf ajDA== X-Forwarded-Encrypted: i=1; AJvYcCWookEUvzdK8H70FM9dtmR07BdeF/EW6AkFiTT+NtQWcychi3JjZoA++wsMdXk+gqnlHxx6okblfec2Yf/dy37g74osCQegQP9+8hGD X-Gm-Message-State: AOJu0Yx6NnpHqXEpxvM+lAVgCugGdO7ZBXDyOSZN2UpkU2uZokooSDbG 79SE9Oo1iC/tsWkATf47NCMn42ZfQBabLaa514f+23hmc3qpYNNX2OS5iMzliwg= X-Received: by 2002:a5d:6484:0:b0:346:47d6:5d17 with SMTP id o4-20020a5d6484000000b0034647d65d17mr10870806wri.57.1713274939982; Tue, 16 Apr 2024 06:42:19 -0700 (PDT) Received: from grappa.linbit (62-99-137-214.static.upcbusiness.at. [62.99.137.214]) by smtp.gmail.com with ESMTPSA id p14-20020a5d48ce000000b00349856b640bsm1353351wrs.67.2024.04.16.06.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 06:42:19 -0700 (PDT) Date: Tue, 16 Apr 2024 15:42:17 +0200 From: Lars Ellenberg To: I-HSIN CHENG Cc: philipp.reisner@linbit.com, christoph.boehmwalder@linbit.com, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] lru_cache: Initialize hlist_head in lc_create Message-ID: Mail-Followup-To: I-HSIN CHENG , philipp.reisner@linbit.com, christoph.boehmwalder@linbit.com, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org References: <20240311030735.233470-1-richard120310@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240311030735.233470-1-richard120310@gmail.com> On Mon, Mar 11, 2024 at 11:07:35AM +0800, I-HSIN CHENG wrote: > Use INIT_HLIST_HEAD to perform the initialization for each pointer to > struct list_head in the variable "slot" to provide more safety and > prevent possible bugs from uninitialized behavior. Completely pointless. It is kcalloc'd. Why explicitly zero-out something that was already explicitly zeroed out to begin with. Lars