public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH blktests 5/7] nvme: delete all ana_groups when removing a port
Date: Tue, 3 Dec 2024 04:58:18 +0000	[thread overview]
Message-ID: <e237466b-4316-4715-a305-c2d2003d256b@nvidia.com> (raw)
In-Reply-To: <20241129132617.400429-6-shinichiro.kawasaki@wdc.com>

On 11/29/24 05:26, Shin'ichiro Kawasaki wrote:
> From: Hannes Reinecke <hare@suse.de>
>
> A port might have several ANA groups, and we have to remove all
> ANA groups with a group id other than 1, otherwise we cannot
> remove the port itself.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> [Shin'ichiro: fixed shellcheck warning]
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

instead of local variable a it could be something meaningful ..
irrespective of that :-

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck

> ---
>   common/nvme | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/common/nvme b/common/nvme
> index dfd9876..8bce403 100644
> --- a/common/nvme
> +++ b/common/nvme
> @@ -491,6 +491,8 @@ _setup_nvmet_port_ana() {
>   
>   _remove_nvmet_port() {
>   	local port="$1"
> +	local cfsport="${NVMET_CFS}/ports/${port}"
> +	local a
>   
>   	if [[ "${nvme_trtype}" == "fc" ]]; then
>   		_nvme_fcloop_del_tport "$(_remote_wwnn "$port")" \
> @@ -499,7 +501,11 @@ _remove_nvmet_port() {
>   				       "$(_remote_wwnn "$port")" \
>   				       "$(_remote_wwpn "$port")"
>   	fi
> -	rmdir "${NVMET_CFS}/ports/${port}"
> +	for a in "${cfsport}/ana_groups/"*; do
> +		[[ "${a##*/}" == "1" ]] && continue
> +		rmdir "${a}"
> +	done
> +	rmdir "${cfsport}"
>   }
>   
>   _create_nvmet_ns() {


  reply	other threads:[~2024-12-03  4:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 13:26 [PATCH blktests 0/7] nvme: add test cases for ANA support Shin'ichiro Kawasaki
2024-11-29 13:26 ` [PATCH blktests 1/7] nvme/031: open-code helper functions Shin'ichiro Kawasaki
2024-12-03  4:55   ` Chaitanya Kulkarni
2024-11-29 13:26 ` [PATCH blktests 2/7] nvme: add _setup_nvmet_port_ana() Shin'ichiro Kawasaki
2024-12-03  4:56   ` Chaitanya Kulkarni
2024-11-29 13:26 ` [PATCH blktests 3/7] nvme: add _setup_nvmet_ns_ana() Shin'ichiro Kawasaki
2024-12-03  4:56   ` Chaitanya Kulkarni
2024-11-29 13:26 ` [PATCH blktests 4/7] nvme/rc: add argument '--ports' to _nvmet_target_setup() Shin'ichiro Kawasaki
2024-12-03  4:57   ` Chaitanya Kulkarni
2024-11-29 13:26 ` [PATCH blktests 5/7] nvme: delete all ana_groups when removing a port Shin'ichiro Kawasaki
2024-12-03  4:58   ` Chaitanya Kulkarni [this message]
2024-11-29 13:26 ` [PATCH blktests 6/7] test/nvme: add test for basic ANA support Shin'ichiro Kawasaki
2024-12-03  4:59   ` Chaitanya Kulkarni
2024-11-29 13:26 ` [PATCH blktests 7/7] test/nvme: add test for rapid namespace remapping Shin'ichiro Kawasaki
2024-12-03  5:00   ` Chaitanya Kulkarni
2024-12-11  8:35 ` [PATCH blktests 0/7] nvme: add test cases for ANA support Shinichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e237466b-4316-4715-a305-c2d2003d256b@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=hare@suse.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=shinichiro.kawasaki@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox