From patchwork Mon Mar 19 00:36:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Lyle X-Patchwork-Id: 10291469 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 9AFD360291 for ; Mon, 19 Mar 2018 00:36:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DB4C28EDF for ; Mon, 19 Mar 2018 00:36:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8261428F56; Mon, 19 Mar 2018 00:36:58 +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 F019028EDF for ; Mon, 19 Mar 2018 00:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754781AbeCSAgz (ORCPT ); Sun, 18 Mar 2018 20:36:55 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:37958 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754301AbeCSAgu (ORCPT ); Sun, 18 Mar 2018 20:36:50 -0400 Received: by mail-pl0-f65.google.com with SMTP id m22-v6so9230686pls.5 for ; Sun, 18 Mar 2018 17:36:50 -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:in-reply-to:references; bh=dcxTjcPhH/IQvaFy6whfvcft6SYZM+NkidfAXrde6Co=; b=vRN6B2uLGFUIUarWB5FI81sUtZhZzz8e+If8hUMWx/4XaIxHQ8LFEv1MdT+VQ0EXP1 JWOksPXUAzkV897ZCiMNzqvzncaZxZLINYceyQ886zD7E7vSS+TA78HyNjatki6HIpZl OJJCZ3tT2TZ3H4KV3kjfDMS7r8FiTbe3wMcNNZBLzxKs8s8JSPRbi3np3u7elvtmLkBo x6zKsAZa9dzPqltUgX875scQLbKlMsVI5wIWD0jBHkqQRABy+jg+rnJGFjODGJkXfs1S tEpBTmmURZKLk+rC5hChj/ltnoUolL6M2+gfw1/tCmuLG42w1Wb0FBc2uwS2exnTdQqH +cXA== 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:in-reply-to :references; bh=dcxTjcPhH/IQvaFy6whfvcft6SYZM+NkidfAXrde6Co=; b=TSFnK950VUbWcfdomIMxkkDkcMTozCTZX+dxm8z2nsD6p6Z5RGP9gmmi2DwppnyGSv dAHnULNtDVbDNcxYjTcb9prMmdejUBKa1xNOj/WKWe53EAkfkkW6PcvSHOucPbYoTHVW ek0cMTexqHOSwrWpFwU1F90k4k7tw7A4PSNfTsb5kScjXzSFcV4hvparHWCl9Y24zrEP 4npIIAg2tlikmBZ9Zxbs7yooojk3eLOyq7VAlValhctSx8J+IqtCFOTisPDQPL7HKN3d P8steD9mgSy+/UHu95A6wR2NehSbmMYNMTJhadFeGi3GKJJiUqcEF5rc+1qcTrAmeeJ3 1GYg== X-Gm-Message-State: AElRT7GCWRaJqjSeSLbAii+sjCZV8xx5Zsf2HD1eR1Vo5O87u4a+44/o EkZoTDSVYapbAeaOHnk+1eonkA== X-Google-Smtp-Source: AG47ELtbHpToAbl3p2yII9hLeZm6XmWz0WNbqUT3NePM4YEYTfBhfTvqqDatzYNV+eJyywIZ3B6Vwg== X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr10156769plb.211.1521419809782; Sun, 18 Mar 2018 17:36:49 -0700 (PDT) Received: from midnight.lan (2600-6c52-6200-09b7-0000-0000-0000-0d66.dhcp6.chtrptr.net. [2600:6c52:6200:9b7::d66]) by smtp.gmail.com with ESMTPSA id a17sm27674857pfc.122.2018.03.18.17.36.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 17:36:49 -0700 (PDT) From: Michael Lyle To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org Cc: axboe@fb.com, Tang Junhui Subject: [for-4.17 08/20] bcache: fix error return value in memory shrink Date: Sun, 18 Mar 2018 17:36:21 -0700 Message-Id: <20180319003633.27225-9-mlyle@lyle.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180319003633.27225-1-mlyle@lyle.org> References: <20180319003633.27225-1-mlyle@lyle.org> 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 From: Tang Junhui In bch_mca_scan(), the return value should not be the number of freed btree nodes, but the number of pages of freed btree nodes. Signed-off-by: Tang Junhui Reviewed-by: Michael Lyle --- drivers/md/bcache/btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 39cc8a549091..b2d4899f48d5 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -719,7 +719,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink, } out: mutex_unlock(&c->bucket_lock); - return freed; + return freed * c->btree_pages; } static unsigned long bch_mca_count(struct shrinker *shrink,