From patchwork Sat May 4 18:38:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10929963 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 E2C631395 for ; Sat, 4 May 2019 18:39:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2F3228758 for ; Sat, 4 May 2019 18:39:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C512F28824; Sat, 4 May 2019 18:39:44 +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 6AF8128758 for ; Sat, 4 May 2019 18:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727490AbfEDSiq (ORCPT ); Sat, 4 May 2019 14:38:46 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:43854 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727472AbfEDSiq (ORCPT ); Sat, 4 May 2019 14:38:46 -0400 Received: by mail-lj1-f195.google.com with SMTP id z5so2743714lji.10 for ; Sat, 04 May 2019 11:38:44 -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=b49wfhLOumPQgXr+cfKeJZHxCawjUFOzEyK1tzSAUts=; b=RwHJ7dZfVpqpBAYmi/ibFYlbZ/kYATHVpdcdtU9nc74g9me2OD/iV5iS4GzSkemCag VRd+qudbu3Iaz4JvKMCP3ayuscMbX9TFON/RoABmjyntW7MWjmkLraeLrn2zAevlyn5Q xC9fOwEVZRUQCB0NoYL5y5FCQhOdLss33UR12iyMiR3XD4g01iim+DVGQsmb07ceauVQ jojWtBBkILKBbRpNYwh2gABontBTZbK6mBkvrrwL/FSz40Wp7N9P+kgQruqH1ueDWOL8 pgR1pIc1eEodYMUqMdfRPhTfKG2wLDpB2qI2OvCxiuRO8gldtHTKdVhBwV8qwkwVfldk cSqA== 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=b49wfhLOumPQgXr+cfKeJZHxCawjUFOzEyK1tzSAUts=; b=r0uL+32sMbXKDFWtdty+3UEf6bA6Z5vsKYIkmUlkpSRCsdf/9XcAjWKOrlKVrAGVpZ CzqWRazBFmNjippfKjUEoSKgbtNtHCF1/yvaCVrARGCvIxs7crGw1Rm3vzoJYTvbl2rk XDNu6gGN/kSfAgZu7Rzp3GJ/hyLOAUNVMZNuTNKlCb1/fi3GUxfej2v7s/+nlnRHEhKW m1kvp04RwljXlQcdzmpLAQ7Vv5kazhuwrkD95Gy0An4aiF93UYAdPXt2LuIGJPTGHc4V IYs9FeXB8gBAoLEOU1HHib1XTdGTcVWIO2NOzMDeMpRzU77UjXXWdoEpS0yWcCH8ToSw naeg== X-Gm-Message-State: APjAAAUnZnpqPbbIEx3tPJiM2xQjnzUJXOU91fQYn7ox5j/tbpHv91gy JnOdY+f/pChDPL1izb1CodMLzA== X-Google-Smtp-Source: APXvYqwwDDNDkYh/TIm9iL///KR7uA/jAIJx0/jMK8G2ANYER2hGicp76hXUrishFf8onWBWUqwkFg== X-Received: by 2002:a2e:2f0e:: with SMTP id v14mr2823075ljv.77.1556995123997; Sat, 04 May 2019 11:38:43 -0700 (PDT) Received: from skyninja.webspeed.dk (2-111-91-225-cable.dk.customer.tdc.net. [2.111.91.225]) by smtp.gmail.com with ESMTPSA id q21sm1050260lfa.84.2019.05.04.11.38.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 11:38:43 -0700 (PDT) From: =?utf-8?q?Matias_Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Konopko , =?utf-8?q?Matias_Bj=C3=B8rling?= Subject: [GIT PULL 19/26] lightnvm: pblk: remove internal IO timeout Date: Sat, 4 May 2019 20:38:04 +0200 Message-Id: <20190504183811.18725-20-mb@lightnvm.io> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190504183811.18725-1-mb@lightnvm.io> References: <20190504183811.18725-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: Igor Konopko Currently during pblk padding, there is internal IO timeout introduced, which is smaller than default NVMe timeout. This can lead to various use-after-free issues. Since in case of any IO timeouts NVMe and block layer will handle timeout by themselves and report it back to use, there is no need to keep this internal timeout in pblk. Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-recovery.c | 7 +------ drivers/lightnvm/pblk.h | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c index 137e963cd51d..865fe310cab4 100644 --- a/drivers/lightnvm/pblk-recovery.c +++ b/drivers/lightnvm/pblk-recovery.c @@ -290,12 +290,7 @@ static int pblk_recov_pad_line(struct pblk *pblk, struct pblk_line *line, fail_complete: kref_put(&pad_rq->ref, pblk_recov_complete); - - if (!wait_for_completion_io_timeout(&pad_rq->wait, - msecs_to_jiffies(PBLK_COMMAND_TIMEOUT_MS))) { - pblk_err(pblk, "pad write timed out\n"); - ret = -ETIME; - } + wait_for_completion(&pad_rq->wait); if (!pblk_line_is_full(line)) pblk_err(pblk, "corrupted padded line: %d\n", line->id); diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 381f0746a9cf..90c703d3f84c 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h @@ -43,8 +43,6 @@ #define PBLK_CACHE_NAME_LEN (DISK_NAME_LEN + 16) -#define PBLK_COMMAND_TIMEOUT_MS 30000 - /* Max 512 LUNs per device */ #define PBLK_MAX_LUNS_BITMAP (4)