Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7712739rwb; Wed, 23 Nov 2022 09:45:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4v2QBW9GtSnv3FLXwC14NTbk1wIjxnueaPeSYjRN/Qb0WyIr3HNKnvr3TEPeLCO3dG2a6o X-Received: by 2002:aa7:d88c:0:b0:468:ffca:6982 with SMTP id u12-20020aa7d88c000000b00468ffca6982mr24013529edq.282.1669225523315; Wed, 23 Nov 2022 09:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669225523; cv=none; d=google.com; s=arc-20160816; b=I2veF17aEcNsAULb4aZGgwHf4DQ30Sj4NGyiVcRb4Vkr9suaVyVLpX0SZpfprvHAsN xVJ9oGtUGd/ngiEoYiv7EYUSXTBX692I45m505w5qWg7NTOPWDNDRD8uEnsY+0rtOuuc x4/TiKtDmfNRqtPl4SQvdoVB+U2NX2NLSH4C6JbZixgHnnXFxxXXRDtFO266u23FC8tb D+O8XKHnX67zfzbZs/Nbegax4OeQpKkthbgFFEDktog3PMS2tDaxA557QuDYj8H269Q0 I+f3OxN0H03s7s8xg4HD3KUvm3lC0fjwpU696Wh3KaMoq5j9CU6wHvTHWgsXgy3UrEKg jJaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kY1l32BjvmTEjJLwJuMtTS3l+ptPCvj6BygkCcwmqdA=; b=07tijBfkl/DVUI7raIKOqCY/sAHdeju2Wl+e12zc2Bfg3LzyWAgrZwV3hJyudc5JcK K/mPivA2SBMWv/3yW9MJCE2DO0c3TB6vWAJKU59eyW+bv079k/VqXo3Irz/FE/qFJ9Dr FpGDgP/oiVhGD7jSALwvyVJE1sIklsvmx3MplYimLqtuCjUurN8ZMqdJebNt/RcDR0mg IZIc4kby32UfztZiRQJwL1wyAUDSUaEqcGEL2tHf5UyKmcOm9ErlHLjaiz13WHVT5mS4 vVy8m+EHmNYOC3sNi8IHIed88RywAZsd+O8KKy1Mmrgwny0AfRRmE3eJ2hQhyuCXn+DY phKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FydYzUiv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa21-20020a170906edb500b007701a050273si14023917ejb.942.2022.11.23.09.44.59; Wed, 23 Nov 2022 09:45:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FydYzUiv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238965AbiKWRjH (ORCPT + 89 others); Wed, 23 Nov 2022 12:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238503AbiKWRjF (ORCPT ); Wed, 23 Nov 2022 12:39:05 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5014898DA; Wed, 23 Nov 2022 09:39:04 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id s5so25794170edc.12; Wed, 23 Nov 2022 09:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kY1l32BjvmTEjJLwJuMtTS3l+ptPCvj6BygkCcwmqdA=; b=FydYzUivVhWzTDIFaXUTJQlHJ+RXRHhbd6TAM7hKoDPhbDMhxSutKnKJaDNkrCJ6mq SxKqG+Gm/HYNo2YpWD6E/QayLjEaU8UIyiUtcWtXcEYxQtPVWfMG36DpDy4zGHvaVzmw IK2GD3H1OTOOy4ApHBk3lACJbLztCIFu0URTfjBl/Y0Yj4YMLQsf59VSVF9wqc4DM0Je IGWpws3Muv7yQA5dDP7nmP7+KjMRuWfaZ8+JVQ9nyiqK2TolF8US0sJ1HS9OLWIKrW23 KIIMW1Vfwg3Gloq166cQI1vFdUK0uOgR+JSwsYkpJz9W6VCnm2tOpxUjmvgCJo1N75Xz Gu5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kY1l32BjvmTEjJLwJuMtTS3l+ptPCvj6BygkCcwmqdA=; b=tCGFNg4DymVx3e5431XPcTbXO/aqqFCEVe8SziXBn/ly5/C6EeEElxbSWB61OWJI+a u1osQ9tP9VQV9SavDDs8wD52URBJO7atn2i36QNt5IjIkxwAka8DfVt0g30mJ7e/4BjB Lieh8GauiI54aIXguYWTQyAfLaWZxz5FnpUwxnk0TS8WVdH4nC6V/gGcXHX+0Gx5928s LiO8EKdJuBqO5tcFDniW1zfz0X8oZLyamLJe+tPv/0URqHJOBQXRs6reoqzr3P9EfLGu ebxBQvdJjOeICHLWltDQvuZj3Kl4OBKplrjqS7JUkh49nPyalGdEadDxkXRhXFYzOi3s 7SvA== X-Gm-Message-State: ANoB5pkB0X2x4BPrvQXH8b0oEEzBZvB/dvTj3luyd/XlFDH3va6x7LIW B4zXk727JosnVfWAbv/h70O4u2UEUHzXeDcfoH0= X-Received: by 2002:a05:6402:10c4:b0:467:7827:232 with SMTP id p4-20020a05640210c400b0046778270232mr27594712edu.268.1669225143120; Wed, 23 Nov 2022 09:39:03 -0800 (PST) MIME-Version: 1.0 References: <20221122213040.4128105-1-haowenchao@huawei.com> <4d21f806-6653-5457-918c-563a3032d128@suse.com> <00f11c61-a53f-c48a-017f-4c06055ea708@huawei.com> <717da158-5a7e-b478-61d3-3753b0b00e01@oracle.com> In-Reply-To: <717da158-5a7e-b478-61d3-3753b0b00e01@oracle.com> From: Wenchao Hao Date: Thu, 24 Nov 2022 01:38:51 +0800 Message-ID: Subject: Re: [PATCH] scsi:iscsi: Record session's startup mode in kernel To: Mike Christie Cc: Wenchao Hao , Lee Duncan , Chris Leech , "James E . J . Bottomley" , "Martin K . Petersen" , open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, liuzhiqiang26@huawei.com, linfeilong@huawei.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 24, 2022 at 1:29 AM Mike Christie wrote: > > On 11/22/22 10:41 PM, Wenchao Hao wrote: > > Sorry I did not highlight the key points. The root reason we need to record > > node_startup mode in kernel is userspace's node_startup mode is unreliable in > > some scenarios: > > > > 1. iscsi node and session is created in initrd, the configure files of these > > nodes would be lost after we switch to rootfs > > 2. someone do iscsiadm -m discovery but did not specify the operation mode, > > the iscsi node's node_startup would be updated to which specified in iscsid.conf > > 3. someone do iscsiadm -m node -o update to update nodes' configure > > > > What's more, it seems "iscsiadm/iscsid" only refuse to logout of an ONBOOT > > session when logout is specificed by "--logoutall". We still can logout an > > ONBOOT session with "iscsiadm -m node -u comamnd". > > logout_by_startup does go by the startup setting, but I think you missed the > session_in_use related code. It checks the mounts and holders already. Just > change it for whatever you need. I think your lvm use case should be covered > by the holder check. If not, add it. I did not enable the iscsid.safe_logout in iscsid.conf, so the session still could be logged out. If tested with iscsid.safe_logout set to "Yes", the issue is solved. Thanks a lot