From patchwork Thu Mar 29 22:05:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10316563 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 21FAD60353 for ; Thu, 29 Mar 2018 22:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B1802A52E for ; Thu, 29 Mar 2018 22:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F416A2A534; Thu, 29 Mar 2018 22:13:36 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAC562A52E for ; Thu, 29 Mar 2018 22:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752675AbeC2WMy (ORCPT ); Thu, 29 Mar 2018 18:12:54 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:42637 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbeC2WHT (ORCPT ); Thu, 29 Mar 2018 18:07:19 -0400 Received: by mail-lf0-f67.google.com with SMTP id a22-v6so10327830lfg.9 for ; Thu, 29 Mar 2018 15:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AGTlfCfbEgdSA3zpRD+YVYrH4kmchjKPgzgIUK2yeV0=; b=WuIr9r29L5zRsTJJwh6rMYzoYG4enj40A5UM34oFI05Fevl4G9CKaQHjFEOojwcsOO 7hl5ID6ur6W22vMoXAjs+143GWVsolqcSgvqDcErksJoOChtTcOEoThsa0oXVp0RApce s654zZvoMLYXxoorlCESllIReM0jMb3FXX/tCO9iL2uffHlZmvwsaD78d/W9dpsZ/UIz zrxTuTpeLrYNk2kk9WVVWEjqsgm7GIvVsVL+M133gZ6Qzwu7bhAtpfCLgKAKo88F2Lsi yHOaPLevwUisdze/eYdJPYmwPDVRSU2k3TEpnB340Wbe04LgzPUZkFLv9jLDV4iWULoc fPTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AGTlfCfbEgdSA3zpRD+YVYrH4kmchjKPgzgIUK2yeV0=; b=lolhARFXdda0gNEzBvfYWMgB7kYWpsthBLEYqDHsoPR1oXm+dtdiEf2gtC2oYAqxix iKHGGdq/4t5pKJoeqO2sRnPwwL0VDJKqn5HcdGXKlnq9YxUBlP0Q0wPH17jYyZ+++Gby NtuYge//5PTkOkapk6o84Js5KOJJrNNMx76TtRWmE6tbLkm286QBg7/tghknTzQq9JhC NBdqdGLeURpoXzw996NWWpxStGBaZdgcKbNd1IMzA2P3ZVaDTDmKcKwwKdXEkCYKxLHb 4ShiulWEVIW0vNNU414fh2VAUzvauILT2/h9nPsFo7XeKFhdmdtD+PYq02wAlDiRKosL OuBA== X-Gm-Message-State: AElRT7H723sQA16UHqbf45VgB1/YFL67hEmYvp1LiBAmE5mYTdfakwIH Kn0cvY45nD5FVFzUEOwIIi+jaA== X-Google-Smtp-Source: AIpwx4/lCb8XEMBvMDNeJ4pdoruPLHQ+I0M+QyT4SGKSawm4UobQIt+GyIcbC9Akx/W5U2HsQ9MH2g== X-Received: by 2002:a19:df54:: with SMTP id q20-v6mr6444004lfj.28.1522361237805; Thu, 29 Mar 2018 15:07:17 -0700 (PDT) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id i89-v6sm1365508lfk.12.2018.03.29.15.07.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 15:07:17 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, javier@cnexlabs.com, Heiner Litz , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 19/37] lightnvm: fix bad block initialization Date: Fri, 30 Mar 2018 00:05:06 +0200 Message-Id: <20180329220524.30363-20-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180329220524.30363-1-mb@lightnvm.io> References: <20180329220524.30363-1-mb@lightnvm.io> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Heiner Litz fix reading bad block device information to correctly setup the per line blk_bitmap during lightnvm initialization Signed-off-by: Heiner Litz Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 43b835678f48..ee936c1ff764 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -460,10 +460,11 @@ static int pblk_bb_line(struct pblk *pblk, struct pblk_line *line, struct nvm_tgt_dev *dev = pblk->dev; struct nvm_geo *geo = &dev->geo; int i, bb_cnt = 0; + int blk_per_lun = geo->nr_chks * geo->plane_mode; for (i = 0; i < blk_per_line; i++) { struct pblk_lun *rlun = &pblk->luns[i]; - u8 *lun_bb_log = bb_log + i * blk_per_line; + u8 *lun_bb_log = bb_log + i * blk_per_lun; if (lun_bb_log[line->id] == NVM_BLK_T_FREE) continue;