Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3440927imu; Sun, 11 Nov 2018 15:09:42 -0800 (PST) X-Google-Smtp-Source: AJdET5fsV0tqVgcE7fZ+m2rZs3JLvcmm7aslOvlfqFz7kQx4Oyrt+H9X7kDDe46A/UD8R863+l8F X-Received: by 2002:a63:5357:: with SMTP id t23-v6mr15652138pgl.40.1541977781970; Sun, 11 Nov 2018 15:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977781; cv=none; d=google.com; s=arc-20160816; b=hku4oHNuzzpMnrmqO0vKft0eoHe5KFKc52Q3E2Tk+oJLa2pg7h95FxoCtfX03IcYPt d0F7/XOgNM6gpyQPfzVBooAt8+0FIGuaEKP6UtSBkOJQBA8DXjQl9zimBg8mcQpefwQf kf8PL/sM3inp6WNXbZSSdq9Mkj3PNxML1SA3EkGbr6XumBUoFN7CwnbZedwrGvD+g40f u7ootqcqQcr2EJsS/xbtkdRmilyvGWJ+aTywLSaYbXUElUcTrjaba9Z2SUzFxQ6abNFP QiDv5Vv03gwoGhK9jz+6NWewOjJpeSpLVnOyaLR6QI4qhXay+hldNOH75b2ORoqaQpRt p0tA== 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=G0fBfJFHJ1hJtm5k62TiamZXs6ZCkYEyNwEAgR91mfk=; b=TkFqWeUguLxnGFSCRpTfoOlWWR+KC7j1rxLuk+L0fcr/u0QSX16DY2UenooMxW/5a1 CVZz5++ej8tCum3yzkXSKCwjSG86pBA1f9hi7ej15qKnw+qdgI58k/ZauH80ne3zYkWU wti1uHTKqVmGE+n5rw2EyHHfuA4zabZim571pxXjSdjNKN/omDSHXcTAmYnTaYzJaMvH RKLjOO/0yz4NLKYRh4EUme3OrBh+y2bkF5EVyKHsfVFsO1aK76xyK3kCvP99yTEDpwDI ziScpxsh55OwHuejJZv1BlLRraEBAKgjlujj/vQHZk5UxhOhGd9cjaqwqI2J1G1mLtWA QZpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JMvvHvTl; 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 o13-v6si17907401pfd.46.2018.11.11.15.09.26; Sun, 11 Nov 2018 15:09:41 -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=JMvvHvTl; 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 S2390163AbeKLI7Q (ORCPT + 99 others); Mon, 12 Nov 2018 03:59:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:51116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390234AbeKLIWD (ORCPT ); Mon, 12 Nov 2018 03:22:03 -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 77C0A223CB; Sun, 11 Nov 2018 22:32:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975526; bh=nDfj/87vkNZFoNgLveqrSC1kV5sKbwIC6llx7hoIXPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JMvvHvTlsriRVdsdMwLsjpOXlHHEfg3KBJjZUmFCjGbVRUGjO3sVkwcWrVxvh8rpE iBH/PYJ5OATjuEfhOeYIznikGv0967+Up8lp3HPLdUuRxgdFXLOQ2H1JAnPy2cv53+ KXChHZHR4WeLojGBJZ6mToPBa/V+UVHRdrJUXNIM= 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.14 004/222] bcache: fix miss key refill->end in writeback Date: Sun, 11 Nov 2018 14:21:41 -0800 Message-Id: <20181111221648.226517852@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -2371,7 +2371,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; }