From patchwork Mon May 18 17:35:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225558 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 1C436C433E2 for ; Mon, 18 May 2020 18:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F089A20829 for ; Mon, 18 May 2020 18:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589826523; bh=92C6p6tlwbBMVt5XS+W92fxk5AXDJDTfJrbzkbFQ0D8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CDi0Jum/lsOLqU+VmMLFXf8QHvzK8tYqTC2fs1d0Gf+xso/jhk3CNumt1rXY9mNgB 3/MeNPhtcY8soXBXdEpB7JB/48PsZJ/OqyUdUdjPXrZfHJWHsYlhwembx7e3vKY5+S 1AusPEQgpAE9GK6YLWCYM0bH9tkHa+4FBLzmPnsw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730787AbgERS2e (ORCPT ); Mon, 18 May 2020 14:28:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:39696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729448AbgERRmg (ORCPT ); Mon, 18 May 2020 13:42:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C868320715; Mon, 18 May 2020 17:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589823756; bh=92C6p6tlwbBMVt5XS+W92fxk5AXDJDTfJrbzkbFQ0D8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PjyqmiU8iJm+kQtk8g2XYxZiqXDlGTOtlN/KEyQHMq5VieT5STm9FL4k6AwLqI6Hv d1aFxYvY7ckmLp7kF4wCQmGFHayK8NZFYLsDQYyV6Mk6pSwDVGuKU0StFZINCi3C2o 17zOftUZPdlfBvj1qpHPC2KasOSN6IyOpl+ZJWX8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , "David S. Miller" Subject: [PATCH 4.9 03/90] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks Date: Mon, 18 May 2020 19:35:41 +0200 Message-Id: <20200518173451.710909306@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173450.930655662@linuxfoundation.org> References: <20200518173450.930655662@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Dumazet [ Upstream commit 14695212d4cd8b0c997f6121b6df8520038ce076 ] My intent was to not let users set a zero drop_batch_size, it seems I once again messed with min()/max(). Fixes: 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()") Signed-off-by: Eric Dumazet Acked-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_fq_codel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -428,7 +428,7 @@ static int fq_codel_change(struct Qdisc q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM])); if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]) - q->drop_batch_size = min(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])); + q->drop_batch_size = max(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])); if (tb[TCA_FQ_CODEL_MEMORY_LIMIT]) q->memory_limit = min(1U << 31, nla_get_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT]));