Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2514690imm; Mon, 24 Sep 2018 05:45:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZwkAj9NvCNiotLuzZdsx0qb5nt8O10Qbtum5rFZMOxJ/X5NQNUlvoYVle9mRZasOV7sjzG X-Received: by 2002:a62:2b50:: with SMTP id r77-v6mr10184514pfr.51.1537793151055; Mon, 24 Sep 2018 05:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793151; cv=none; d=google.com; s=arc-20160816; b=nQMw0gwQUqdyl2JJvPqPs3o8oe9u6H4RFXe3tg7wGzQ8WSJuNX/n+9PuZpyXynJ/q1 al8agpb3HVRQQsAHr3nRWAovzLsLVhp+hPzMHoDWc0bcRW92UWFjkWxz0AKwl7kGRHez nMNquxPIofT+EwB+e5j6F2ySi8EM0WAp6/U7gypxNoH4keL8tUPE3wqxibH0MnBKJQH7 1vuRj7WcpaUUDE4ZP+lLvJi1K+K/OdvFU2kY84lDE2zleePg2aGn6JEDElGvQos7oXWt q4OmH0OyvmkXV7g6h0cfNZC2KkM7ffo0CZ6+55Blckkj/wa9Q/fh0rTnpvUU2WLUv03j twTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=C52fP23uhhykwote0MsxQDUGTunhxqm60BmIBtq0aGA=; b=c1zyKoGfmImg2XjF9JaTnD6Y6dwyYdDgQRwQJlANVEAW1CBAtjg4a/YoCf9lL2Q1Ua 5UKEzHujnm6q3DiJydMcXowQ0w/rQ7e9DzZadUpj6I8do1g5hzclgm6EOkSUlV2Ee1b/ JcFuhvE9W8IQJ5DBntRrd7mD2j+Os+jzEus7vGY2bX3LxWe9rdX0bsTo94Z2nc05JSon s/x4W268NJim38aV+duvTCqNA2OMGceOh3XjtZxfQ8jUGRZZou5/DzkPLL7CAUrn8go0 m3w1S/ObEailz2a5fXLs6P90Tt8iwW+wgW4gRP4O1WmcM8goLEBpNm5vUQzZ/0byHoCM tSOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6-v6si2957996pgb.62.2018.09.24.05.45.35; Mon, 24 Sep 2018 05:45:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388987AbeIXSpM (ORCPT + 99 others); Mon, 24 Sep 2018 14:45:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59410 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729754AbeIXSpM (ORCPT ); Mon, 24 Sep 2018 14:45:12 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3AE621099; Mon, 24 Sep 2018 12:43:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Holmberg , =?UTF-8?q?Matias=20Bj=C3=B8rling?= , Jens Axboe , Sasha Levin Subject: [PATCH 4.18 197/235] lightnvm: pblk: assume that chunks are closed on 1.2 devices Date: Mon, 24 Sep 2018 13:53:03 +0200 Message-Id: <20180924113123.963039202@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Holmberg [ Upstream commit f6352103d2e0ad2d2066725eb19bfdfb8763239b ] We can't know if a block is closed or not on 1.2 devices, so assume closed state to make sure that blocks are erased before writing. Fixes: 32ef9412c114 ("lightnvm: pblk: implement get log report chunk") Signed-off-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/lightnvm/pblk-init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -716,10 +716,11 @@ static int pblk_setup_line_meta_12(struc /* * In 1.2 spec. chunk state is not persisted by the device. Thus - * some of the values are reset each time pblk is instantiated. + * some of the values are reset each time pblk is instantiated, + * so we have to assume that the block is closed. */ if (lun_bb_meta[line->id] == NVM_BLK_T_FREE) - chunk->state = NVM_CHK_ST_FREE; + chunk->state = NVM_CHK_ST_CLOSED; else chunk->state = NVM_CHK_ST_OFFLINE;