From patchwork Thu Apr 14 01:49:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenchao Hao X-Patchwork-Id: 12811987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F2BAC433EF for ; Wed, 13 Apr 2022 12:39:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235526AbiDMMlT (ORCPT ); Wed, 13 Apr 2022 08:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbiDMMlR (ORCPT ); Wed, 13 Apr 2022 08:41:17 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80E4949FBC; Wed, 13 Apr 2022 05:38:55 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kdhsm2FKqzFpfj; Wed, 13 Apr 2022 20:36:28 +0800 (CST) Received: from dggpemm500017.china.huawei.com (7.185.36.178) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 13 Apr 2022 20:38:53 +0800 Received: from huawei.com (10.175.101.6) by dggpemm500017.china.huawei.com (7.185.36.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 13 Apr 2022 20:38:52 +0800 From: Wenchao Hao To: Mike Christie , Lee Duncan , Chris Leech , "James E . J . Bottomley" , "Martin K . Petersen" , , , CC: , Wenchao Hao Subject: [PATCH 0/2] Fix multiple iscsi session unbind event sent to userspace Date: Wed, 13 Apr 2022 21:49:45 -0400 Message-ID: <20220414014947.4168447-1-haowenchao@huawei.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500017.china.huawei.com (7.185.36.178) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org kernel would send ISCSI_KEVENT_UNBIND_SESSION twice to userspace, for open-iscsi, this would trigger iscsi_stop twice. We should fix this issue. Here introduced a new session state ISCSI_SESSION_UNBOUND to address it. Once session state is ISCSI_KEVENT_UNBIND_SESSION, it means __iscsi_unbind_session() has been called for this session and do not need to execute any more. Reference:https://github.com/open-iscsi/open-iscsi/issues/338 Wenchao Hao (2): scsi: iscsi: introduce session UNBOUND state to avoid multiple unbind event iscsi: set session to FREE state after unbind session in remove session drivers/scsi/scsi_transport_iscsi.c | 45 +++++++++++++++++++++-------- include/scsi/scsi_transport_iscsi.h | 1 + 2 files changed, 34 insertions(+), 12 deletions(-)