From patchwork Wed Jul 12 23:38:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khazhy Kumykov X-Patchwork-Id: 9837565 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4248602A0 for ; Wed, 12 Jul 2017 23:38:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5A93286B7 for ; Wed, 12 Jul 2017 23:38:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 996DB286C4; Wed, 12 Jul 2017 23:38:45 +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=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MIME_HEADER_CTYPE_ONLY, MIME_NO_TEXT, RCVD_IN_DNSWL_HI, T_TVD_MIME_NO_HEADERS 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 2B218286B7 for ; Wed, 12 Jul 2017 23:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751036AbdGLXia (ORCPT ); Wed, 12 Jul 2017 19:38:30 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33493 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbdGLXi3 (ORCPT ); Wed, 12 Jul 2017 19:38:29 -0400 Received: by mail-pf0-f179.google.com with SMTP id e7so20164475pfk.0 for ; Wed, 12 Jul 2017 16:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=zcqO3ClyuT8OzC7/UeERLjO/DLypW5ZxHAyzxEaDMVk=; b=f2qgnwX6lPpoJMYWelXryveyy9xdLW4m9F5B/xgWqVNBUh1N9V+q8fDdSPG2SxHgGw dJhXRJkQu7mvFGJaEn4pWibNEx0uN0AHr92Gtt4KdXDqJBusHAg6U3TNx4LPSeLFeY7k qYpiQLCJqHtSdqXOVKWlyhHdwfO8e+FYVHAhNcIoAuPQhNJiPun6dHHMBdAaUocmx/B7 C1r9geSOBfBEgInVCK3BRRbWSXas2Wgxe7H9nQDf8psxxCnhLuUv/JokRubxmPe0vSqb r38NWd/mZyDSbOWHIUGece1QwbXfvtiRG5uw40Sr3kAGXR9CDM/pkgMt4fI/CarHgoRu U7/Q== 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; bh=zcqO3ClyuT8OzC7/UeERLjO/DLypW5ZxHAyzxEaDMVk=; b=llAmfm1wMWCyC7RhdvWMWGlWAVECOw2I86YFxgDX+UPQj3Wjo2NcZubj/eNBE38IT0 EBpZ/qL2T2+EZtplS0oUewwWDBw5yq8aIYqtRPVFBBNIEplQ4sle2kCr8GeceYob/iox gip6QTYsxDT2JanmE9oPdCndtR8gr3/LtHobfVISvvRgS6AEWlMpV8ylXwxkcBBpN92I EafViuCJmctL7aSei7fMf8zaZUoYPeWPvmRnkdbJ9YejNSmewVY4oJOve4dPkX2QHQXM s6RiQH6qVkP2gkvUKa2Nf4emDcKN7GSHdCLa8M2/dAZlTZzD8jTAVFseYlu/VM4eiEz/ tsnw== X-Gm-Message-State: AIVw112Qb7i5Q7GmVjRtzp3HCmK5kOJsh20sS/yZqjp5ZTNIb5VkPb9B 5Y42+PJdr5Gu0NQCdWMIeQ== X-Received: by 10.99.5.82 with SMTP id 79mr6134936pgf.134.1499902708128; Wed, 12 Jul 2017 16:38:28 -0700 (PDT) Received: from khazhy.svl.corp.google.com ([100.123.228.94]) by smtp.gmail.com with ESMTPSA id r28sm8741680pfd.4.2017.07.12.16.38.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 16:38:27 -0700 (PDT) From: Khazhismel Kumykov To: lduncan@suse.com, cleech@redhat.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, open-iscsi@googlegroups.com, Khazhismel Kumykov Subject: [PATCH] libiscsi: Remove iscsi_destroy_session Date: Wed, 12 Jul 2017 16:38:12 -0700 Message-Id: <20170712233812.49572-1-khazhy@google.com> X-Mailer: git-send-email 2.13.2.932.g7449e964c-goog Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP iscsi_session_teardown was the only user of this function. Function currently is just short for iscsi_remove_session + iscsi_free_session. Signed-off-by: Khazhismel Kumykov --- with "libiscsi: Fix use after free race during iscsi_session_teardown" removing the last user. drivers/scsi/scsi_transport_iscsi.c | 16 ---------------- include/scsi/scsi_transport_iscsi.h | 1 - 2 files changed, 17 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index a424eaeafeb0..924ac408d8a9 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2210,22 +2210,6 @@ void iscsi_free_session(struct iscsi_cls_session *session) } EXPORT_SYMBOL_GPL(iscsi_free_session); -/** - * iscsi_destroy_session - destroy iscsi session - * @session: iscsi_session - * - * Can be called by a LLD or iscsi_transport. There must not be - * any running connections. - */ -int iscsi_destroy_session(struct iscsi_cls_session *session) -{ - iscsi_remove_session(session); - ISCSI_DBG_TRANS_SESSION(session, "Completing session destruction\n"); - iscsi_free_session(session); - return 0; -} -EXPORT_SYMBOL_GPL(iscsi_destroy_session); - /** * iscsi_create_conn - create iscsi class connection * @session: iscsi cls session diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 6183d20a01fb..b266d2a3bcb1 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -434,7 +434,6 @@ extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, unsigned int target_id); extern void iscsi_remove_session(struct iscsi_cls_session *session); extern void iscsi_free_session(struct iscsi_cls_session *session); -extern int iscsi_destroy_session(struct iscsi_cls_session *session); extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, int dd_size, uint32_t cid); extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);