From patchwork Fri Nov 11 01:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Reed X-Patchwork-Id: 1702349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=oAGhF03M; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7gzD2Djhz23mY for ; Fri, 11 Nov 2022 12:26:46 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1otIoU-00080K-A3; Fri, 11 Nov 2022 01:26:34 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1otIoS-0007zr-9D for kernel-team@lists.ubuntu.com; Fri, 11 Nov 2022 01:26:32 +0000 Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id F17D9412C2 for ; Fri, 11 Nov 2022 01:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1668129991; bh=6qYq/KbsYMM9ZyafBn7+XN0IvGoApQubCE/bQLhxuHA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oAGhF03MxMcFRBomTwAP77YAWQsTB12iKv/r6mrerXq9u3wHE/QF32+I8hHesWjfS M0JWKwJ4aTkfeR4wBDAZKkwJ5uxsm2bmpYCb6xJAxKh0zAcMNyf/+aWUaxXcaLDez8 3pU5Fowjbm3xg86vLHYlwebdghj2VM+t48WbiEW1rOr7vfC+wpLhisxJUayE/XGMpb lqOzBB+eeIOUke61QgFy9ZatYLsIoBneFt4wGfqxFQxEcnKKMSmwvSmnfFUKCu6i2H CpAlpmmMkrT0H1KnmutG6I0Z5uE6T3B6ijGdYCrq+p3N+jcRFWmtqSDzk9jaT0+1O5 E5b/hU1Cf6QWQ== Received: by mail-ot1-f72.google.com with SMTP id a22-20020a0568300b9600b0065c0cef3662so1703035otv.14 for ; Thu, 10 Nov 2022 17:26:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6qYq/KbsYMM9ZyafBn7+XN0IvGoApQubCE/bQLhxuHA=; b=5KJFkdT0xb4WEpM/cu7bqrAVbuwElQPNHlYGEyMx65j40YQ42/VE/Cy1kogTDXK5Om +sprudpdxiwpKGYFk+Gxc2qIP9Ncbssd5Va48IbU+w26mHpHabJEzG00oUlZ7DRkpYZh CEddHtFPYtuMyRFjOluEn/lnX4eiC796kkDruj9shl2ielsEsn/Pb4vNrdJs1eYunzxt CmXF8C7AAKM3XKyeOuwgxyT/sqyNO5oz6EB+v3OPIfyK7WIj17Sl7MWpMfsjiI8HB1ea BeHBEdeyN3wrTjTyYtnlg7Hvp2IcpzQ1lyPCCMmkzHuBlzdAbWXsbtj5kbnB+Ugz/DGP HugQ== X-Gm-Message-State: ACrzQf3l5fnyz6olLHHHXLgRKqg5nCa5eQXjnHO6nvOY7dBijhXLFTHk aj6QjHGV/tMQxGqWEQuQVo3lbwQkr8MUNEdS3aydy8DNnLl1yDVApAC2p2Mev6UnhG9TY5OX1vx t9lr1h+L/JI4yJOBIulo1iioaUty0B3yD8KO6NcpbIQ== X-Received: by 2002:aca:2b08:0:b0:35a:e9d:7a6c with SMTP id i8-20020aca2b08000000b0035a0e9d7a6cmr2610223oik.0.1668129990717; Thu, 10 Nov 2022 17:26:30 -0800 (PST) X-Google-Smtp-Source: AMsMyM6H60y58beQzIcMYn5mqr0BuFRiHQpA2wkyno6QV68tznynbgmcyrlBNXl1RFcTjdBehhxGrg== X-Received: by 2002:aca:2b08:0:b0:35a:e9d:7a6c with SMTP id i8-20020aca2b08000000b0035a0e9d7a6cmr2610218oik.0.1668129990251; Thu, 10 Nov 2022 17:26:30 -0800 (PST) Received: from localhost ([2600:1700:1d0:5e50:4099:f1a2:cfad:287f]) by smtp.gmail.com with ESMTPSA id i2-20020a4ac502000000b00480816a5b8csm360756ooq.18.2022.11.10.17.26.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 17:26:29 -0800 (PST) From: Michael Reed To: kernel-team@lists.ubuntu.com Subject: [SRU][J][PATCH 1/4] nvme-fabrics: parse nvme connect Linux error codes Date: Thu, 10 Nov 2022 19:26:23 -0600 Message-Id: <20221111012626.39213-2-michael.reed@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221111012626.39213-1-michael.reed@canonical.com> References: <20221111012626.39213-1-michael.reed@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Amit Engel This fixes the assumption that errval is an unsigned nvme error Signed-off-by: Amit Engel Signed-off-by: Christoph Hellwig (cherry picked from commit ec9e96b5230148294c7abcaf3a4c592d3720b62d) Signed-off-by: Michael Reed BugLink: https://bugs.launchpad.net/bugs/1989990 --- drivers/nvme/host/fabrics.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 668c6bb7a567..faf21483b26d 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -271,6 +271,12 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl, { int err_sctype = errval & ~NVME_SC_DNR; + if (errval < 0) { + dev_err(ctrl->device, + "Connect command failed, errno: %d\n", errval); + return; + } + switch (err_sctype) { case (NVME_SC_CONNECT_INVALID_PARAM): if (offset >> 16) {