Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932291AbbLNKYJ (ORCPT ); Mon, 14 Dec 2015 05:24:09 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:38150 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752691AbbLNKYH (ORCPT ); Mon, 14 Dec 2015 05:24:07 -0500 X-AuditID: cbfee61b-f793c6d00000236c-00-566e98c5bea4 From: Chao Yu To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org Subject: [PATCH] lightnvm: fix incorrect nr_free_blocks stat Date: Mon, 14 Dec 2015 18:23:29 +0800 Message-id: <006401d13659$8f89ff70$ae9dfe50$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdE2WTIoPbWRzKmxS4+kfoVnsjLWQw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t9jAd1jM/LCDD5uYbG4vGsOm8WK7UdY HJg8uq/+YPT4vEkugCmKyyYlNSezLLVI3y6BK2PF97nMBS1sFZNnbmZuYGxg7WLk5JAQMJG4 vuQyO4QtJnHh3nq2LkYuDiGBpYwS/yfvgXJeMUrM2LuGBaSKTUBFYnnHfyYQW0RASOLTvZdg k5gFFCR+3dsEZgsL2EhcetsINpVFQFXiwJMnjCA2r4ClRP/xXSwQtqDEj8n3WCB6tSTW7zzO BGHLS2xe85YZ4iIFiR1nXzNC7NKTOHxmFztEjbjExiO3WCYwCsxCMmoWklGzkIyahaRlASPL KkaJ1ILkguKk9FyjvNRyveLE3OLSvHS95PzcTYzgoH0mvYPx8C73Q4wCHIxKPLyZy3LDhFgT y4orcw8xSnAwK4nwJljlhQnxpiRWVqUW5ccXleakFh9ilOZgURLn3XcpMkxIID2xJDU7NbUg tQgmy8TBKdXA6La7Q/T6mYdRxczzRW7kZkz7tfhBskbtig06AhJrfW4tVcnytlg62WWXVMqH iLL91/mzzU+r1tTnR5acWNu34TK/4hp3CyYrhzPTVL/Mknm8M9Da7eADlkmlQQnX2Pg2m217 OV/z8K5rTzkDzppNfXmbNejEH1MPlcPH9jzhfx5v07449IXcTCWW4oxEQy3mouJEAI/2dPVW AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 991 Lines: 31 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 --- drivers/lightnvm/gennvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 35dde84..6b504a2 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; -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/