From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BE24C433DB for ; Fri, 26 Feb 2021 08:44:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD37064E6C for ; Fri, 26 Feb 2021 08:44:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD37064E6C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hT5J7mvBZGkT1uC7C5Ab88kHMuSLr++0b33xPfaUUbw=; b=QEd6MeUQjEgdObYIncP1hZsKa 8FUrdOD165Sdx1F/p971TVRG4uqVfCi5bMIdlsJWS93cjGG44kBLzC/ZRdsCIitVKTq4JQqEk5jUv uqNP/0L8WvuK2z6kqlE/Kg0F3KPvERujF7bhv96nL1JDbC9w7dcjDa/ZUMvnWxSKQ8RRc3D7QzISL VX3nDCY5y/uqhTLmc9VS7Tq/atM2wAKUtvqTH1wt4alkSWDJOrNQu6h8lfyWz5bTv3b2bJxY3777e /gQcgAD7ge1i+zXQzXQFyGgfgRF3MmMxb9PUSaFDR3SRwCbgHEbHnpcUngm+VtoMBa82w+A1hA4xQ gxi9yrE3w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFXNZ-0007Ic-Gh; Fri, 26 Feb 2021 07:17:37 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFXNW-0007Gk-6u for linux-nvme@lists.infradead.org; Fri, 26 Feb 2021 07:17:35 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BBA35ADE3; Fri, 26 Feb 2021 07:17:32 +0000 (UTC) From: Hannes Reinecke To: Christoph Hellwig Subject: [PATCH 2/4] nvme: add NVME_REQ_CANCELLED flag in nvme_cancel_request() Date: Fri, 26 Feb 2021 08:17:26 +0100 Message-Id: <20210226071728.106923-3-hare@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210226071728.106923-1-hare@suse.de> References: <20210226071728.106923-1-hare@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210226_021734_383868_128858ED X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keith Busch , Sagi Grimberg , Daniel Wagner , linux-nvme@lists.infradead.org, Hannes Reinecke , Chao Leng , Keith Busch Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org NVME_REQ_CANCELLED is translated into -EINTR in nvme_submit_sync_cmd(), so we should be setting this flags during nvme_cancel_request() to ensure that the callers to nvme_submit_sync_cmd() will get the correct error code when the controller is reset. Signed-off-by: Hannes Reinecke Reviewed-by: Daniel Wagner Reviewed-by: Keith Busch Reviewed-by: Chao Leng --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index bde1b22ca7f2..bf32460c180a 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -380,6 +380,7 @@ bool nvme_cancel_request(struct request *req, void *data, bool reserved) return true; nvme_req(req)->status = NVME_SC_HOST_ABORTED_CMD; + nvme_req(req)->flags |= NVME_REQ_CANCELLED; blk_mq_complete_request(req); return true; } -- 2.29.2 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme