From patchwork Mon Dec 18 21:27:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "monty_pavel@sina.com" X-Patchwork-Id: 10119587 X-Patchwork-Delegate: snitzer@redhat.com 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 7C4D860327 for ; Mon, 18 Dec 2017 14:09:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68C5A28AFE for ; Mon, 18 Dec 2017 14:09:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D40F28CBD; Mon, 18 Dec 2017 14:09:28 +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=-5.0 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, FREEMAIL_FROM,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DC0728AFE for ; Mon, 18 Dec 2017 14:09:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CF9E7F7C2; Mon, 18 Dec 2017 14:09:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0CA37F780; Mon, 18 Dec 2017 14:09:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EBC1A4BB79; Mon, 18 Dec 2017 14:09:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vBIE9MRZ030606 for ; Mon, 18 Dec 2017 09:09:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id BE40261283; Mon, 18 Dec 2017 14:09:22 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B443F60C54 for ; Mon, 18 Dec 2017 14:09:20 +0000 (UTC) Received: from mail115-100.sinamail.sina.com.cn (mail115-100.sinamail.sina.com.cn [218.30.115.100]) by mx1.redhat.com (Postfix) with SMTP id DA956C00C7D8 for ; Mon, 18 Dec 2017 14:09:14 +0000 (UTC) Received: from unknown (HELO yyp.?)([220.113.8.82]) by sina.com with ESMTP id 5A37CC05000096F3; Mon, 18 Dec 2017 22:09:12 +0800 (CST) X-Sender: monty_pavel@sina.com X-Auth-ID: monty_pavel@sina.com X-SMAIL-MID: 155774133068 Date: Mon, 18 Dec 2017 16:27:58 -0500 From: monty To: dm-devel@redhat.com Message-ID: <20171218212758.GA12360@yyp.> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 18 Dec 2017 14:09:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 18 Dec 2017 14:09:17 +0000 (UTC) for IP:'218.30.115.100' DOMAIN:'mail115-100.sinamail.sina.com.cn' HELO:'mail115-100.sinamail.sina.com.cn' FROM:'monty_pavel@sina.com' RCPT:'' X-RedHat-Spam-Score: -0.009 (DATE_IN_FUTURE_06_12, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 218.30.115.100 mail115-100.sinamail.sina.com.cn 218.30.115.100 mail115-100.sinamail.sina.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Cc: monty_pavel@sina.com Subject: [dm-devel] [PATCH] persistent-data: fix bug about btree of updating internal node's minima key in btree_split_beneath. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: fixbugaboutbtree_split_beneathfunc@redhat.com, thisbugmaycauseakeyhadbeeninsertedtobtree@redhat.com, "butdm_btree_lookupcannotfindthekeyinbtreelater."@redhat.com List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 18 Dec 2017 14:09:26 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: monty --- drivers/md/persistent-data/dm-btree.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index f21ce6a..25ce5ec 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -694,6 +694,8 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key) if (key < le64_to_cpu(rn->keys[0])) { unlock_block(s->info, right); s->nodes[1] = left; + if (key < le64_to_cpu(ln->keys[0])) + ln->keys[0] = cpu_to_le64(key); } else { unlock_block(s->info, left); s->nodes[1] = right;