Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3494067imu; Sun, 11 Nov 2018 16:21:59 -0800 (PST) X-Google-Smtp-Source: AJdET5ezBt4dsySMkLXw4KRdwQxNh7YupnSlszRZszFSqnMWK6K1UKOvruWFNcICZ3iwalcC6jBK X-Received: by 2002:a17:902:4623:: with SMTP id o32-v6mr17753224pld.187.1541982119838; Sun, 11 Nov 2018 16:21:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541982119; cv=none; d=google.com; s=arc-20160816; b=YfQpHL780833AL4mjPVmUd8ginkOrtLDd11vvtGq6Dn/VaQH0YNVdJw3nqIJH7m3Np jq6XxBo0MDV6ysf0FQaNFSe7AdnMxPxmIn420k6LyAUpJP7xqmsvX/IPQjOIjAjA0Um0 HSBZhNU2HL4ajvbMnrbQXn9HxGbRYtSvPOTxu5ckptkR1MB32j4HilXjm+9PGcPqECr5 MujWDP8AO2PezSAM2x4sQsyGuD8wKpOhaY9+LLoTe9xqNOfwEOftzQemxyBlVhvoRWaA LZQzrDHK2KGkoJm08RnVD7OfzoThFcEa77eNl2Ruzi81aeBBNHws6IWu/g/hWypFmrwC 62Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ESH6HDpObdWzygBlC4SjkxuPF+JHA9CcWRQg+H+x1W0=; b=o36E6yE838/ac4UmviOqlkyDobqDqvitiSAgtbyL9E6TD13XrUEQHGm5miocMNTmgH Byg+tyttTtqVkzceAV6EootruYe5X0dvgo9f28in5F4UZnM7wM5Wdbvp94lHB47Sy8Y4 YAiCblZwXmvNd8yLiaevrPf6o23Lkh/5frI2rausLU8suuvE9GzyWsN12AB33cGd9+vq +x1gXeDHZsBYigtnkVnaxDDHB394f/07uSzrEUUnddq9LQXSzvy01udXVMdQntY3mhSE 8CAgRPg4ctsL3Y979ID0nxDgk+5l0REUtXDA8Cpt2c9kUAsrrO3u4KeZOa8Soapo1Rkx 0Zew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qW6q91uN; 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 b17si8267731pgk.581.2018.11.11.16.21.45; Sun, 11 Nov 2018 16:21:59 -0800 (PST) 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=@kernel.org header.s=default header.b=qW6q91uN; 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 S1730213AbeKLKKk (ORCPT + 99 others); Mon, 12 Nov 2018 05:10:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:58446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729745AbeKLIQw (ORCPT ); Mon, 12 Nov 2018 03:16:52 -0500 Received: from localhost (unknown [206.108.79.134]) (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 4538521582; Sun, 11 Nov 2018 22:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975217; bh=56w4urZoLR/JVTW7gYbyLLdKKNuExbc1EBPoPvoDUQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qW6q91uNN+yCU0WWGXSGGGHc3N047nHu+VDvcpal4PzgggvMM/tV1LcnI6JiAUH/O LQeLyLgPTMkFwFjiVNRiTleOkuRFKvArFqS9Hmkh4MmD6i+TqShAIlXFgXFH4mBYY5 wXQFhoYTHEqvO7MwvCjl/6ROVX/o7bRwSsdJRRtw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tang Junhui , Coly Li , Jens Axboe Subject: [PATCH 4.19 015/361] bcache: fix miss key refill->end in writeback Date: Sun, 11 Nov 2018 14:16:02 -0800 Message-Id: <20181111221622.021937037@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tang Junhui commit 2d6cb6edd2c7fb4f40998895bda45006281b1ac5 upstream. refill->end record the last key of writeback, for example, at the first time, keys (1,128K) to (1,1024K) are flush to the backend device, but the end key (1,1024K) is not included, since the bellow code: if (bkey_cmp(k, refill->end) >= 0) { ret = MAP_DONE; goto out; } And in the next time when we refill writeback keybuf again, we searched key start from (1,1024K), and got a key bigger than it, so the key (1,1024K) missed. This patch modify the above code, and let the end key to be included to the writeback key buffer. Signed-off-by: Tang Junhui Cc: stable@vger.kernel.org Signed-off-by: Coly Li Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/md/bcache/btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -2434,7 +2434,7 @@ static int refill_keybuf_fn(struct btree struct keybuf *buf = refill->buf; int ret = MAP_CONTINUE; - if (bkey_cmp(k, refill->end) >= 0) { + if (bkey_cmp(k, refill->end) > 0) { ret = MAP_DONE; goto out; }