From patchwork Wed Oct 18 15:45:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 116317 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6210929qgn; Wed, 18 Oct 2017 08:45:33 -0700 (PDT) X-Received: by 10.84.197.131 with SMTP id n3mr15832023pld.227.1508341533498; Wed, 18 Oct 2017 08:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508341533; cv=none; d=google.com; s=arc-20160816; b=Uo2OoXsM9RoHJsFbyoTkzQXyXQLZc4yJ3rw/Dy20CBBEAbyPp5c0rxmQz5SbgZbwhT IR9yp9fCTTWToxGXGz/usSYOkgnwtqjldzNcioJ8zhGD7z2T3+Fz4+x6qzLHfOCumZGQ fISb5t84pUrGfKV6i3iylCMoB8Xh8xEjqat6lOBFP2iCKR6jzuy2oCcngpXm7oJiukCk Vw/a2GffrT4b/XArCzC3On7WF2c/iWokpCqbM2IRKWRAH2VNFOP71xz8dR+WOajgNzxj T1VwfNt9TYeY25pliRhlvFhX+eLD/KK14e+vQGXCsdLmIRICT/3rIt3WtUjY5t4WDYDX LWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=QZ1Urso+e2iA5YxDK4o7KJteqy0G/cFMZ/XQqN0iR6I=; b=MUNs/IVSrUUlncl3f6ZLh9/5JdWxDGyOVWzh2STYbsoYRTHjodJocsUovq1Ah5VqaQ FGupXn8/1rQyKXBGhF/MVml443/luz6N+5AaVl+KmAEkbZtqTAzdAO4rURNPKaQ1YAod qjVdjp6s9/9n1jQQ/lR0ucASc4pXS57kwVD6QBZsqtfWyc54zTWeVSlmBtBja5+0wLU4 U81ClBy5Xlnp/8485hjBxgtbSK3cnx3Vq5HR0zB1JDl7npHG/j85vLB5nNl70IjvgBeG oV6CXHU0TIilWZ4aH4JJE6Qzt/sfBSRZEAaU+T9YGBoToyIGGzF7MqcJyQC9q+RQZQNE qPLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QFDBnRC8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si7046181pgo.720.2017.10.18.08.45.33; Wed, 18 Oct 2017 08:45:33 -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=@linaro.org header.s=google header.b=QFDBnRC8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751777AbdJRPpb (ORCPT + 27 others); Wed, 18 Oct 2017 11:45:31 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54741 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751681AbdJRPpY (ORCPT ); Wed, 18 Oct 2017 11:45:24 -0400 Received: by mail-wm0-f66.google.com with SMTP id i124so11010415wmf.3 for ; Wed, 18 Oct 2017 08:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=QZ1Urso+e2iA5YxDK4o7KJteqy0G/cFMZ/XQqN0iR6I=; b=QFDBnRC8bTjYfr0GUDWDD+MJ3PJqJtvvTC3okK4nJrUcSOWvYmzwHhijpJi+n/Hu3X /x9JZDnaPLg4dbds9He0O5qqwX4YC91lTW3Besjdx/SqyAJD1B0YXB88uqG2//vV9zFK urBfRyROaHM11d8U92CDwZsY96gibM9Z+D3U8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QZ1Urso+e2iA5YxDK4o7KJteqy0G/cFMZ/XQqN0iR6I=; b=ZtYfYEERqQ/Cw/VMOLoDLhVXEZ7GwwBfmVe1JQiw9G25KPz7U+yVElEDPg9VItUmKn 2PChya5dCYSOx5hvJ9tsCvF7bt/BvCSbqRzKtsI3KZDteZ3P1tJzNG5G13d7x2UKnve6 a32SzFOwuT1qIBlLV2P5e8q0UTuRDMiC7ekuPHpiFUHnBsgcndTlvLzWYKZ3Aw1zPjP5 tOfsMNbs932zdqtG05SGZ1xU7JwiprLR3Z5Kli9tDLZSIhd8dv1lf9T1XPXPjvhKu1n9 wAxsF9kJsMeKT3OtJMOwTH9WU8bO3prZxqvTu7jPmvlK6VT9NRWvohxutYq4Bg4UOC/M YL6w== X-Gm-Message-State: AMCzsaWUcEmy+akAxBt0Nbgz/JwkBiJtuBZoJV9yGRtRJId7sKNi6lYu LgF4pNzH2BPz8Wt4LASif25D605a2Gk= X-Google-Smtp-Source: ABhQp+SZgFTTCKvrV4Th5sxHjof4EOCYk1vtjnvLtel50IWxQzqUGMSF/tDCYHwtQsZmkPaX7ENAyg== X-Received: by 10.28.105.76 with SMTP id e73mr7292450wmc.116.1508341522895; Wed, 18 Oct 2017 08:45:22 -0700 (PDT) Received: from localhost.localdomain ([154.145.244.244]) by smtp.gmail.com with ESMTPSA id u4sm9078615wre.1.2017.10.18.08.45.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 08:45:22 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net Cc: Ard Biesheuvel Subject: [PATCH] lib/dynamic_queue_limits.c: relax BUG_ON to WARN_ON in dql_complete() Date: Wed, 18 Oct 2017 16:45:15 +0100 Message-Id: <20171018154515.16751-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Even though calling dql_completed() with a count that exceeds the queued count is a serious error, it still does not justify bringing down the entire kernel with a BUG_ON(). So relax it to a WARN_ON() instead. Signed-off-by: Ard Biesheuvel --- lib/dynamic_queue_limits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c index f346715e2255..24ce495d78f3 100644 --- a/lib/dynamic_queue_limits.c +++ b/lib/dynamic_queue_limits.c @@ -23,7 +23,7 @@ void dql_completed(struct dql *dql, unsigned int count) num_queued = ACCESS_ONCE(dql->num_queued); /* Can't complete more than what's in queue */ - BUG_ON(count > num_queued - dql->num_completed); + WARN_ON(count > num_queued - dql->num_completed); completed = dql->num_completed + count; limit = dql->limit;