From patchwork Mon Oct 16 17:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Lyle X-Patchwork-Id: 10009427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69D3B601D5 for ; Mon, 16 Oct 2017 17:35:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5852F28687 for ; Mon, 16 Oct 2017 17:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AED628689; Mon, 16 Oct 2017 17:35:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A315A28687 for ; Mon, 16 Oct 2017 17:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754169AbdJPRfC (ORCPT ); Mon, 16 Oct 2017 13:35:02 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:54406 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754274AbdJPRe7 (ORCPT ); Mon, 16 Oct 2017 13:34:59 -0400 Received: by mail-pg0-f68.google.com with SMTP id l24so7311510pgu.11 for ; Mon, 16 Oct 2017 10:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyle-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=rCPp2jV8viorqOp/qNTlvP3VThT7zYUrzN3elbFgqlc=; b=cgu61/vpND9ooVVvphRC+GwI4VxvAA5hqcHYm4T1VnEdEDRpuRXB5Hq9pz2wu+EiTm CxCWTmZ4uFXciPuvUlu0BMLrZy8xJ2tPE8spwRHyOE6qalreDCPaCsNi1HKuFuo2nAFy gePFXuAasBWh9zaKYL/rWjqdv2tuMG9Jf5TgUB0MnwNB37WioHM4A3bD64VQhaucv34j 2H7RX6RTKNnbC5iYIS8I0jV6X9WNXiytHM+jYaNnHEe/ds6MD+XHiuQJsmsCQNvJlOK9 C9qBVH52e07fPV7e2j74KGH7fQvuwI2BEtldzekri99LMeKFSa/1NeNHQxLgxIhc9WHc ZrDA== 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=rCPp2jV8viorqOp/qNTlvP3VThT7zYUrzN3elbFgqlc=; b=MPZsqXhkRVHNW2ZZnCY/8Qvl0VSJuCfYBfDn+c5xWoUPjpf1RKuCVIABdN6AnrM6xw 3QrJnduQ0zZV051Qg8OmWNOTX8YPnjBWu0HsFtYG0I6Mu8qE5DZfqyXZbc330HdKfI1e mlP1fA24V2CRzKuSuB/8Lc5udlc2xmAZnzwNKEgg4BPsCiIQXDHwclbLIeV+RaGg1S/9 GoKD3jc4Uif7eBlzPW7Gxo4je7gGrwixKwYKX2FgHXGrULK98V8VLFAHGzfIQqy9LU2R EmszEzDf11CtU5sN7w7w35tbYsLbZV/t2K8a9xyDAmHxVE/6eJpFb2O2uJlXQVo0S6ao FjdA== X-Gm-Message-State: AMCzsaVKmkIZPbdp8XUfoINksXFLC3WBl9o+71vbuHo0G7boOzlv0fun FwKgqGp3QeVn+ad2bXL7tFvnSA== X-Google-Smtp-Source: AOwi7QBTkvhMh9eMJwkDwoGrSvhYGSmpwmgDSMCI+hsbN8G9jMLN4NXbUHt38kSpPmv2RmGA4xt2Kw== X-Received: by 10.99.116.25 with SMTP id p25mr8782906pgc.327.1508175298127; Mon, 16 Oct 2017 10:34:58 -0700 (PDT) Received: from localhost.localdomain (68-189-67-104.dhcp.prtv.ca.charter.com. [68.189.67.104]) by smtp.gmail.com with ESMTPSA id c127sm16569197pga.34.2017.10.16.10.34.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 10:34:57 -0700 (PDT) From: Michael Lyle To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org Cc: axboe@kernel.dk, Michael Lyle Subject: [PATCH] bcache: writeback rate clamping: make 32 bit safe Date: Mon, 16 Oct 2017 10:34:47 -0700 Message-Id: <20171016173447.27253-1-mlyle@lyle.org> X-Mailer: git-send-email 2.11.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sorry this got through to linux-block, was detected by the kbuilds test robot. NSEC_PER_SEC is a long constant; 2.5 * 10^9 doesn't fit in a signed long constant. Signed-off-by: Michael Lyle Reviewed-by: Coly Li --- drivers/md/bcache/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c index 4dbe37e82877..e548b8b51322 100644 --- a/drivers/md/bcache/util.c +++ b/drivers/md/bcache/util.c @@ -238,8 +238,8 @@ uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done) * don't let us sleep more than 2.5 seconds (so we can notice/respond * if the control system tells us to speed up!). */ - if (time_before64(now + NSEC_PER_SEC * 5 / 2, d->next)) - d->next = now + NSEC_PER_SEC * 5 / 2; + if (time_before64(now + NSEC_PER_SEC * 5LLU / 2LLU, d->next)) + d->next = now + NSEC_PER_SEC * 5LLU / 2LLU; if (time_after64(now - NSEC_PER_SEC * 2, d->next)) d->next = now - NSEC_PER_SEC * 2;