From patchwork Tue Jan 12 06:49:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8013791 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA697BEEE5 for ; Tue, 12 Jan 2016 06:51:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A317120114 for ; Tue, 12 Jan 2016 06:51:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCE3420138 for ; Tue, 12 Jan 2016 06:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761297AbcALGuS (ORCPT ); Tue, 12 Jan 2016 01:50:18 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38396 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753363AbcALGt4 (ORCPT ); Tue, 12 Jan 2016 01:49:56 -0500 Received: by mail-wm0-f52.google.com with SMTP id b14so303588475wmb.1 for ; Mon, 11 Jan 2016 22:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=sYQMM3ImoOjUKN0eKFeYeuN3qA1KwI8SJcN8AEClj+M=; b=ZIYPtwHD0btTDsQB+SqQ8C8fPAP0EpfbQ2m4FnyE90qmEO1ohJXvOWdGJTxoWlCVHX cfZrTsg7JC49eioNBJi4iwsglw/1PSkjIFiamScdAzZWoUup21Wl5P/Y8vYMth4/QnRV wj/Tn8Rb2F5J9rKgHbCYn9BMQ5eAHbgkZlfNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=sYQMM3ImoOjUKN0eKFeYeuN3qA1KwI8SJcN8AEClj+M=; b=Ur8/xitx2RbOsh6ev6xXAFcYGEUiMGicjKK0hdpNR1YuZjx1GFJyefU1lgEbg5X9aj kzvpf7Wxd9cfV/9XA8qNf4ps8hTP1+oriMMSOOYamt6xiK9ngrY2daAZ6t3VwND7/vTq FFalkt0kRYflHhDqbG9PJOkGnSI7cc4j1KJjr3iBisTGS4hCIOX2rKWi3aMhgRKFGz7i DvOpR2v1qD9f2S/wdv2/9KvOvi/frdnA65EnKCl1HqkEvfammMKkVPaCNzB/uNNKPBMY 2rhdjVGLK2kHhLDo15E9XUYnhD7Voi6Enh7aUjSjVECjZhxMekvDck7f842+eZDqIEON /v2w== X-Gm-Message-State: ALoCoQlXzOwK4GSMEf5F5Hcx0WZP1NNCQk71epoPwz4ZYLxBBUEggwiXzu+okpezt/mr4zDNubmkCinZLuZUiNfngvpn5S4dGQ== X-Received: by 10.28.51.17 with SMTP id z17mr12958921wmz.26.1452581395350; Mon, 11 Jan 2016 22:49:55 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id yz5sm70776886wjc.36.2016.01.11.22.49.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 22:49:54 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: Chao Yu , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 02/25] lightnvm: fix incorrect nr_free_blocks stat Date: Tue, 12 Jan 2016 07:49:16 +0100 Message-Id: <1452581379-18162-3-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me> References: <1452581379-18162-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chao Yu When initing bad block list in gennvm_block_bb, once we move bad block from free_list to bb_list, we should maintain both stat info nr_free_blocks and nr_bad_blocks. So this patch fixes to add missing operation related to nr_free_blocks. Signed-off-by: Chao Yu Signed-off-by: Matias Bjørling --- drivers/lightnvm/gennvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 62c6f4d..2a96ff6 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -89,6 +89,7 @@ static int gennvm_block_bb(struct ppa_addr ppa, int nr_blocks, u8 *blks, list_move_tail(&blk->list, &lun->bb_list); lun->vlun.nr_bad_blocks++; + lun->vlun.nr_free_blocks--; } return 0;