From patchwork Sat Oct 20 16:45:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 10650563 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 B0D8413A9 for ; Sat, 20 Oct 2018 16:45:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 951092861E for ; Sat, 20 Oct 2018 16:45:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E6C62864B; Sat, 20 Oct 2018 16:45:13 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 CDF242861E for ; Sat, 20 Oct 2018 16:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727590AbeJUA4M (ORCPT ); Sat, 20 Oct 2018 20:56:12 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39005 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbeJUA4M (ORCPT ); Sat, 20 Oct 2018 20:56:12 -0400 Received: by mail-pf1-f196.google.com with SMTP id c25-v6so17896147pfe.6 for ; Sat, 20 Oct 2018 09:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nPoRqCUtq87g4Q4OhMche08swLSS+gcvFhH4DUOPcG4=; b=BV/WqOIRQmtUYjjgicAO94K+k75fbGknM7NCBIVGIStwHqoJlY/lSzUtJnY2KyEAE0 qgO41t9FJwny3TywJB6ajMQp1LwmLTy+mmnvo2QXawWm2qu807VF21YppPRc+nsGMn2y O4o9s/yeDWNF6nYOlhX7hRPQ8emiAOjFdkDQY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=nPoRqCUtq87g4Q4OhMche08swLSS+gcvFhH4DUOPcG4=; b=UM6UeJxygvkHohEvz+/95VGRC3ahLeiOkDjwzCdODrO09Qzi6UGPum4cUcL4aWmpIP h2L7Lb0BvKj1nRdxFtfVLb8sYn/EcLB+4PlTwCs0V6swwY3odCep9TSvlMWS6glqi9wW T7xxkpawMcyF0vV+eWcP1x6icx05m4OdeLfZSjsGW/DbDSvlNyfMTUXZ8J/zKIvlEiMx dUxGu8A+jInTId3okyoWJBrc3jrG7Q87hZnRBKxKJyPDujI1iXfsKNYz9TIwURGcOYQj CAj+cJJaZhox84+pPLT34u4emWMYpKKl5UyhfGSCT6aaD6Q1B2H8JVi3PQXS2RC3P6aq qEMQ== X-Gm-Message-State: ABuFfog8TvxC74vQy2m+V6fBLIHlS+xEziYvCIx5l7eUSNKacrAjlauC pzk0chQ+LAVrrvQcaQ5+ozTQIg== X-Google-Smtp-Source: ACcGV60jOLxG8vl4nc+tR3lz6owbY91OflCqX/ARRnJA1/cp6DHAtjErw0MM7/zhyyefJMaAQgXEfw== X-Received: by 2002:a63:4904:: with SMTP id w4-v6mr36752591pga.303.1540053909532; Sat, 20 Oct 2018 09:45:09 -0700 (PDT) Received: from roland-x1-yoga.digitalvampire.org ([2601:647:4600:7ac7:fd39:320b:21cd:f739]) by smtp.gmail.com with ESMTPSA id a64-v6sm34270014pfe.32.2018.10.20.09.45.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 09:45:08 -0700 (PDT) From: Roland Dreier To: "Martin K . Petersen" , "Nicholas A . Bellinger" Cc: Christoph Hellwig , target-devel@vger.kernel.org Subject: [PATCH 1/2] target: Set response length for REPORT TARGET PORT GROUPS Date: Sat, 20 Oct 2018 09:45:04 -0700 Message-Id: <20181020164504.8644-1-roland@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roland Dreier One more place where we can return the length we actually fill in. Signed-off-by: Roland Dreier Reviewed-by: Christoph Hellwig --- drivers/target/target_core_alua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index e46ca968009c..4f134b0c3e29 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -268,7 +268,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd) } transport_kunmap_data_sg(cmd); - target_complete_cmd(cmd, GOOD); + target_complete_cmd_with_length(cmd, GOOD, rd_len + 4); return 0; } From patchwork Sat Oct 20 16:45:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 10650565 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 A9DD313A9 for ; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9990F2861E for ; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BC9A2864B; Sat, 20 Oct 2018 16:45:24 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 39D9A2861E for ; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727605AbeJUA4Z (ORCPT ); Sat, 20 Oct 2018 20:56:25 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46266 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbeJUA4Z (ORCPT ); Sat, 20 Oct 2018 20:56:25 -0400 Received: by mail-pf1-f195.google.com with SMTP id r64-v6so17879219pfb.13 for ; Sat, 20 Oct 2018 09:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SbI8oDJA49SSJ3tpaoLtgquZxZpFFqX3+aA41ktuzD0=; b=jWIlIt/Jf5x6leVAFOBLnw8K6/VtI7Iz4VB5B7kYO1cJeZQFeUQhr4AxEBMyfDC0Qq SKTPUf/gpxocodLapFSxzzN+Q56xaGMU6W6Y8LmfVqHnFQh9hrNxV7MIFDvRD4fpPUrl yRIJsTqJ1LrOv2fsq8xT6HIAsV3a8K4B2lQog= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=SbI8oDJA49SSJ3tpaoLtgquZxZpFFqX3+aA41ktuzD0=; b=C3vOlWqVeDZmsUlwl5MjsTTmVqfzbhpmzbliu4VP5ENWBs0K1j8oOLDKe3XvScH3Q5 Wk/WwAkoIiGo1wHv3H0VT+VYoMCyIUDKImQPlc+lDR60Ak5cA6RGEd09uOW2mqDk5ymR pj+3ld9/N0BPOo9DRB6UMI9IARhQUVBtV1OlZBHOTzKn3Z69zlZqcDtfMBcVVSMgGcEB k6PB7mg+ewfGAVuDnh3kEF90hWBiflr3czsH6ojXVfYc5ATv628UbMMwpfQYA6FwPdBs S3MDWuJWCoVAJjV4ehBzdPasUrpJjRVh35Uk+TQkPxIjD5sRA5uRxdbSDuQ3J7gOGrxF i+Xg== X-Gm-Message-State: ABuFfoi8eKMyS2TIRh8O1JWA2XyBjN4ptDk4sSeWGWFe3szWXhL+4eOE hSGdbbIyIgBUjHQsStytzCyIJA== X-Google-Smtp-Source: ACcGV62NhluPGE0eOUrUKmn8B5TcRifra6fvx6izv5m2qigQz2TJhA3zf1qCAQwcPMaaUuuo9wHCJg== X-Received: by 2002:a63:6246:: with SMTP id w67-v6mr6295389pgb.53.1540053921998; Sat, 20 Oct 2018 09:45:21 -0700 (PDT) Received: from roland-x1-yoga.digitalvampire.org ([2601:647:4600:7ac7:fd39:320b:21cd:f739]) by smtp.gmail.com with ESMTPSA id q25-v6sm43337885pfk.154.2018.10.20.09.45.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 09:45:20 -0700 (PDT) From: Roland Dreier To: "Martin K . Petersen" , "Nicholas A . Bellinger" Cc: Christoph Hellwig , target-devel@vger.kernel.org Subject: [PATCH 2/2] target: Don't request modules that aren't even built Date: Sat, 20 Oct 2018 09:45:16 -0700 Message-Id: <20181020164516.8719-1-roland@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roland Dreier If, for example, I don't enable CONFIG_TCM_PSCSI, then every time I load the target subsystem, I get an annoying Unable to load target_core_pscsi kernel log message. Instead let's only request_module() on things if that code is enabled. Signed-off-by: Roland Dreier Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 86c0156e6c88..eee222db0a14 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -205,19 +205,19 @@ void transport_subsystem_check_init(void) if (sub_api_initialized) return; - ret = request_module("target_core_iblock"); + ret = IS_ENABLED(CONFIG_TCM_IBLOCK) && request_module("target_core_iblock"); if (ret != 0) pr_err("Unable to load target_core_iblock\n"); - ret = request_module("target_core_file"); + ret = IS_ENABLED(CONFIG_TCM_FILEIO) && request_module("target_core_file"); if (ret != 0) pr_err("Unable to load target_core_file\n"); - ret = request_module("target_core_pscsi"); + ret = IS_ENABLED(CONFIG_TCM_PSCSI) && request_module("target_core_pscsi"); if (ret != 0) pr_err("Unable to load target_core_pscsi\n"); - ret = request_module("target_core_user"); + ret = IS_ENABLED(CONFIG_TCM_USER2) && request_module("target_core_user"); if (ret != 0) pr_err("Unable to load target_core_user\n");