From patchwork Mon Nov 28 21:38:55 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: 9450553 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 1968A6071C for ; Mon, 28 Nov 2016 21:43:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B83A27BFC for ; Mon, 28 Nov 2016 21:43:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 006BD27E3E; Mon, 28 Nov 2016 21:43:33 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 8896127BFC for ; Mon, 28 Nov 2016 21:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755822AbcK1Vk5 (ORCPT ); Mon, 28 Nov 2016 16:40:57 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35906 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755535AbcK1Vjm (ORCPT ); Mon, 28 Nov 2016 16:39:42 -0500 Received: by mail-wm0-f65.google.com with SMTP id m203so21231273wma.3 for ; Mon, 28 Nov 2016 13:39:41 -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-transfer-encoding; bh=wXMTZ819Yoywd28iuOnL7IPvbOLm5oQhKlWy4PkndVY=; b=eZl3ITOD03f9y/VgaGvlLoP2nZgk75p+mZsuWaPca9khCvsd8umYLP4ZxhRL9evyNw mBA1Pn5tvRZFzirtwrflOX34UpDh0Cy52Zxvtldmfd9fmW53IYW0s1sxxOFX/Zq3sMuo jkcXd//c8xCe4FafspEN5RrCszR1Lk/N7WoZo= 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-transfer-encoding; bh=wXMTZ819Yoywd28iuOnL7IPvbOLm5oQhKlWy4PkndVY=; b=QOqo01rN0MA6zk1ODERlXc+MWoOsywkPeUfVpBsiMztozHrYCRyz9iyAP2bfHJioN5 AyO5jrF15w+KfWF7HdXkzBz2rqSONbsRz6Ok6Bb8yEFpRltVeCU1ebz0a3uiRt57S6y+ AW+q1gNVA9U6DNEuxrRjbRL/qoohJwRNH9KpkRRPAWVCyjmu3kWwKuUzjvIcqyxDODwA JuH5vXWSiVSDyiesDQYFYaUUApv7e0WL3ve3mn7z0YWQJ5h0YIV8d2L15Z7/hohMYPdS MfYQ9sjbGZgo7drpKVg2WO8AzJu5qyDf4nUr8BTOwqZELsA7IilBIjkraMbcb8orm99S M9eg== X-Gm-Message-State: AKaTC02JNBudaQRY9HLLQ4BiRars1s/n5jcHfKAIpGoaj+3kkrMSgCElsx/WQgg5DQ0bhw== X-Received: by 10.28.230.197 with SMTP id e66mr22185536wmi.12.1480369180544; Mon, 28 Nov 2016 13:39:40 -0800 (PST) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id w79sm30825843wmw.0.2016.11.28.13.39.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 13:39:40 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: axboe@fb.com, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 04/23] lightnvm: do not protect block 0 Date: Mon, 28 Nov 2016 22:38:55 +0100 Message-Id: <20161128213914.12516-5-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161128213914.12516-1-m@bjorling.me> References: <20161128213914.12516-1-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-Virus-Scanned: ClamAV using ClamSMTP From: Javier González Device blocks should be marked by the device and considered as bad blocks by the media manager. Thus, do not make assumptions on which blocks are going to be used by the device. In doing so we might lose valid blocks from the free list. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/gennvm.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c index 730d736..a7e17fa 100644 --- a/drivers/lightnvm/gennvm.c +++ b/drivers/lightnvm/gennvm.c @@ -371,12 +371,6 @@ static int gen_blocks_init(struct nvm_dev *dev, struct gen_dev *gn) block->lun = &lun->vlun; block->id = cur_block_id++; - /* First block is reserved for device */ - if (unlikely(lun_iter == 0 && blk_iter == 0)) { - lun->vlun.nr_free_blocks--; - continue; - } - list_add_tail(&block->list, &lun->free_list); }