Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932395AbbLNLmT (ORCPT ); Mon, 14 Dec 2015 06:42:19 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37824 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932275AbbLNLmS (ORCPT ); Mon, 14 Dec 2015 06:42:18 -0500 Subject: Re: [PATCH] lightnvm: fix incorrect nr_free_blocks stat To: Chao Yu References: <006401d13659$8f89ff70$ae9dfe50$@samsung.com> Cc: linux-kernel@vger.kernel.org From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <566EAB17.8010200@lightnvm.io> Date: Mon, 14 Dec 2015 12:42:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <006401d13659$8f89ff70$ae9dfe50$@samsung.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1084 Lines: 30 On 12/14/2015 11:23 AM, Chao Yu wrote: > 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; > Thanks Yu, Applied. -- 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/