Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1197926imm; Wed, 23 May 2018 11:54:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3hagfzEJEgnCh1ylib4xemApEnQzd/8Ev5fv3g3ESYIqAoRMQkARVFJQ7s+HtkGMs8kf5 X-Received: by 2002:a65:4307:: with SMTP id j7-v6mr3323544pgq.101.1527101656531; Wed, 23 May 2018 11:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527101656; cv=none; d=google.com; s=arc-20160816; b=JdMJGmTXDtJaCd+OLk8xxIez4NtB1orMfDoe4e4iQ9ctNlFmLtiXqWJ5y2B++e8ixe L4bIIQNlkuPVpBIU4eXGCbP6m0pbLQOJLSR3mBjq2jimnkj+tOSRFSBWiE4C8nbUzfin 67X8gPTB+ZbvUA5xMt8i0MMgNClMwbEUgC4esfzCkU7twMs3awe9XDcGHbsRK2fbkvEb +zaC4NUZdKAIqklnq379yyQNjinLod1grKoVLgzip43xz6bti7SxaIPd/ZoOOfuUcpBT 3qyZ4Hv4qlWLErBs4g7bUHpZdQJENes26e4iOyZCFZwkaVB24W4AQuxT5/pxoW+8vBU0 4/mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=W5yLHWE7mcS5c2mjZVN4Ij7QK/tyWbh66dOuIMHdr68=; b=h8qQglQoxsqqoaIsKUIP/3jcYnALKtEhjyLPWva9BNF+1kcuRzBmOC+Q4Wqrj3dBR9 66fpXqf7OSSvQyMvOmoEEZkUwZlO6kcjBUt+vUgAiLcx6c7fHz0S6yK0hD117zoSgYWj k5WRjSMlZ4t5ASgmxBdochNyoa1IUiaCRmg/QN9VSkzbyHm1y0/tH5AOwAizSls2KPrS mIPEvpgxfIj9gxcOzgtvwIwUg7P4L0p1ybLFew/DjlU4UY+wWjUyPD3iAguBlq0tt5ky he1+hqvS1qRt38sLcqLDUneuoI25W1x8vw1RwVvUpvYyd/Nqk0pD1f6p7QuK2vRsuuEd xbSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=L69sxDuC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a187-v6si15731648pgc.238.2018.05.23.11.54.01; Wed, 23 May 2018 11:54:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=L69sxDuC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934156AbeEWSwj (ORCPT + 99 others); Wed, 23 May 2018 14:52:39 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:40644 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934066AbeEWSwh (ORCPT ); Wed, 23 May 2018 14:52:37 -0400 Received: by mail-io0-f170.google.com with SMTP id g14-v6so24010641ioc.7; Wed, 23 May 2018 11:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W5yLHWE7mcS5c2mjZVN4Ij7QK/tyWbh66dOuIMHdr68=; b=L69sxDuChHmWLJUt79V32Tdq4hOLXJztXG0C2nxFyV1TsUZ9C2Cwz4cYiDGJL495Bc rTz4CWFJLKoIYt70IkQyB/k95TmgKInLjThS4GzRElvISX5g/NDl/MYppRFW3n4Blzbs e8i8sNLM7kpGbt58fY3W1pbXpARkLexOOeIDw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W5yLHWE7mcS5c2mjZVN4Ij7QK/tyWbh66dOuIMHdr68=; b=WZihyr9Ksa3/fluO5wSMVZUhfWVLCTQGE48ALSkQ36rpNnxNGmYZ44mU8Cj4pQFiq1 R/GpJeW/QjFgf0abfs6mJvOAKGevMzDA4P9wTPO/dLMQtJ9+Z7jhPal70ZyZvWHKpbZy W9k7rpd7LAtcu9mlz2KetzJuimfPuld3tJQCfOtmcGmvhbpd0qwjF3ytnalIno3hbUMT NMozXagllrXEq6CUtXq0gIngGopKnSiC+l+ZfOqbvAkmx0bfzkX6XHDiRlJ5Ov2BwrfI t9K7L83dlQnJbkGGVCpcwY6pdp3vJKUi7zdyQoraD9m52+SrVp5GS9LgcMpnWY+QX6YU t1GA== X-Gm-Message-State: ALKqPwfLlTQa2ud0DghxW9wDQ8z1gS1VqgfxiGeibmLdkjPuWeuqVrsn JRq1vJ58rJhFJtl3GrnwoZ8E4+Sav/yBMYN6dhY= X-Received: by 2002:a6b:6803:: with SMTP id d3-v6mr3727369ioc.48.1527101556528; Wed, 23 May 2018 11:52:36 -0700 (PDT) MIME-Version: 1.0 References: <20180523172500.anfvmjtumww65ief@linux-n805> <20180523183103.cdgv4slom62y56wi@linux-n805> In-Reply-To: <20180523183103.cdgv4slom62y56wi@linux-n805> From: Linus Torvalds Date: Wed, 23 May 2018 11:52:25 -0700 Message-ID: Subject: Re: semantics of rhashtable and sysvipc To: Davidlohr Bueso Cc: Thomas Graf , Herbert Xu , Andrew Morton , Manfred Spraul , guillaume.knispel@supersonicimagine.com, Linux API , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 11:47 AM Davidlohr Bueso wrote: > Note that even if the allocation was guaranteed, there are still param validations > and rhashtable_init() can return -EINVAL. So? It's not going to happen, because you're not going to give garbage parameters. Why would you add a BUG_ON() for something that cannot happen? You might as well sprinkle them randomly in every damn place. And even if somebody screws up the parameters because they are being stupid, then SO WHAT? rhashtable_init() won't initialize the pointers, and we'll get a NULL pointer dereference. And hey, we'll probably get it later during boot, once the system is actually up and running, and that NULL pointer dereference might even get logged in the system logs now because the machine booted successfully, and mnaybe it will even get sent to a distro and debugged. So at what point was there _any_ advantage in doing a BUG_ON() for a crazy case? Really. Linus