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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 54A19C76191 for ; Wed, 24 Jul 2019 20:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26DBE21841 for ; Wed, 24 Jul 2019 20:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998799; bh=bYsA1hM4KbfAUhdnYF4lW5xsmIlyiMU7e9Rn3uGY43Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PghuiQMHNcWs2GMWi1uRrjJDjBaSUxg+EI3Js4dRCU8+4allNfHsEFH8jaT+rfLWX b4zL3sVPb5QR0Kj5a96r1i261Yv0dKLf/vaG1u02RpioznDApA4v7LXkAkk50jQRso 7Nse3F2pLthU4TPlXKZ/J6vSO+ZRB+fFihaNMYbo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392638AbfGXUFO (ORCPT ); Wed, 24 Jul 2019 16:05:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:56566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392621AbfGXUFL (ORCPT ); Wed, 24 Jul 2019 16:05:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48CBA20665; Wed, 24 Jul 2019 20:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998710; bh=bYsA1hM4KbfAUhdnYF4lW5xsmIlyiMU7e9Rn3uGY43Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rVTlymAjieAdSYdhakS55ee6yKKeUufngtfNa0HryKvZ8heEYhEBOKgQnzJE4URJd LPCYZpoQOS2f207BuoJl98Lz+olE3tvAMnGM/bNmKM2hNx++He2pbVUNopXEP8qC9j u+zm2zt5ccryWcj+Z6UGwcPfl3QEol/F6FQ11Foo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Minwoo Im , Chaitanya Kulkarni , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.19 088/271] nvme-pci: properly report state change failure in nvme_reset_work Date: Wed, 24 Jul 2019 21:19:17 +0200 Message-Id: <20190724191702.759910137@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit cee6c269b016ba89c62e34d6bccb103ee2c7de4f ] If the state change to NVME_CTRL_CONNECTING fails, the dmesg is going to be like: [ 293.689160] nvme nvme0: failed to mark controller CONNECTING [ 293.689160] nvme nvme0: Removing after probe failure status: 0 Even it prints the first line to indicate the situation, the second line is not proper because the status is 0 which means normally success of the previous operation. This patch makes it indicate the proper error value when it fails. [ 25.932367] nvme nvme0: failed to mark controller CONNECTING [ 25.932369] nvme nvme0: Removing after probe failure status: -16 This situation is able to be easily reproduced by: root@target:~# rmmod nvme && modprobe nvme && rmmod nvme Signed-off-by: Minwoo Im Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index c8eeecc58115..03e72e2f57f5 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2294,6 +2294,7 @@ static void nvme_reset_work(struct work_struct *work) if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_CONNECTING)) { dev_warn(dev->ctrl.device, "failed to mark controller CONNECTING\n"); + result = -EBUSY; goto out; } -- 2.20.1