From patchwork Fri Oct 26 08:12:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Holmberg X-Patchwork-Id: 10657071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBEBE1751 for ; Fri, 26 Oct 2018 08:13:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB99A2C0E4 for ; Fri, 26 Oct 2018 08:13:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5942C11E; Fri, 26 Oct 2018 08:13:02 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B4A172C0E4 for ; Fri, 26 Oct 2018 08:13:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726180AbeJZQtD (ORCPT ); Fri, 26 Oct 2018 12:49:03 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:38195 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbeJZQsx (ORCPT ); Fri, 26 Oct 2018 12:48:53 -0400 Received: by mail-it1-f194.google.com with SMTP id i76-v6so680802ita.3 for ; Fri, 26 Oct 2018 01:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owltronix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ZSk+vaI/1PdBVCuPWBLaeX/wD8mWlhTzJ8mRM+gr6n0=; b=d1vYLkVgHBieLHu7bmTiu7ussyvllHywUObgx3oSYPgrirOVfnPe/SzhSCrBy481OC H0iwbw5ls+8gJeDe8zaKzSOEt40rpa09ihGJ3/8ndk/8BA7QrT834brsYpzkA5PPXsry rvqMJV4Wlp0k3LxT8XNP6g6KNLLmpFzYMLO7F2IxYRNV2ISLcDJWqbG/49pYnz9/6jP9 K8KQlh55bqUugao6fe3tMrDzy6AGHyhPBGplRIX0dqQ0obHCwlO0YXW8e4hMGmSvRwwu eww3hCqQStgUhH/JLsaSnQFqYAAg2i+fN35TyskzkuabUT9gc5V6gc/k6htrZ1237KeR 3x/w== 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; bh=ZSk+vaI/1PdBVCuPWBLaeX/wD8mWlhTzJ8mRM+gr6n0=; b=rNQKTAIxYNbmJOb6KuS6e2zAs5ERlaR8+WhLco0i/zgStsjnTL0/7Hm/K5sv5ClWy9 uGhHvpVTG1pv+50U/VkWd5+867keybRtniuoS7defQvsSsKS9iPU1/YGmAl9N0gmGJM7 PS2cokEOUImjegb9ZqE/WUknhAIg/EEECmPTievabAo0f/ConF7FeNfoTMV1+C5vyLcU Vt758huk23WNVK3tErJGpVaNGgjIxglXzgcR/4SFJh315DuIYiw9IkhH6A5RnEqOPrZd EN8JsKQZt/VmVRT3ZiveczmMqVbWZJ7ApsQcMu/3++Ja7p+B1NJpOfsIuyWt/N3//3Gk 7PxQ== X-Gm-Message-State: AGRZ1gLeA38+Z+ziBQitlJ+N3rpiqcs1BrtqKHK5IwxszrJvjt3HSFoW PUKCJ/LdIzWk4xSSYNwAK5OQyKDqKg9nEA== X-Google-Smtp-Source: AJdET5c5rhtvgCjNSUGFiZSEk6/gFKCm83GxoJOgwyRtDHnNpOx9hTSNH3LPNkCWuL9ZYiJaUJl9uw== X-Received: by 2002:a24:1706:: with SMTP id 6-v6mr3336366ith.16.1540541569917; Fri, 26 Oct 2018 01:12:49 -0700 (PDT) Received: from titan.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id v193-v6sm1580973ita.2.2018.10.26.01.12.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Oct 2018 01:12:49 -0700 (PDT) From: Hans Holmberg X-Google-Original-From: Hans Holmberg To: Matias Bjorling Cc: linux-block@vger.kernel.org, Javier Gonzales , linux-kernel@vger.kernel.org, Hans Holmberg Subject: [PATCH] lightnvm: pblk: fix chunk close trace event check Date: Fri, 26 Oct 2018 10:12:24 +0200 Message-Id: <1540541544-7761-1-git-send-email-hans.holmberg@cnexlabs.com> X-Mailer: git-send-email 2.7.4 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 The check for chunk closes suffers from an off-by-one issue, leading to chunk close events not being traced. Fix this. Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states") Signed-off-by: Hans Holmberg --- drivers/lightnvm/pblk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 6944aac43b01..6581c35f51ee 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -531,7 +531,7 @@ void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd) if (caddr == 0) trace_pblk_chunk_state(pblk_disk_name(pblk), ppa, NVM_CHK_ST_OPEN); - else if (caddr == chunk->cnlb) + else if (caddr == (chunk->cnlb - 1)) trace_pblk_chunk_state(pblk_disk_name(pblk), ppa, NVM_CHK_ST_CLOSED); }