public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: shinichiro.kawasaki@wdc.com, chaitanyak@nvidia.com,
	kbusch@kernel.org, sagi@grimberg.me, hch@lst.de,
	linux-nvme@lists.infradead.org, venkat88@linux.vnet.ibm.com,
	sachinp@linux.vnet.ibm.com, linux-block@vger.kernel.org,
	gjoyce@linux.ibm.com
Subject: Re: [PATCHv3 blktests] nvme: add test for creating/deleting file-ns
Date: Wed, 19 Jun 2024 22:51:51 +0530	[thread overview]
Message-ID: <9797ab67-e7d1-4624-87bc-9d7cd8406089@linux.ibm.com> (raw)
In-Reply-To: <b4itgwyvsk6xhlgccleshe2v5dmyqwh2tkualueotqdz3ljxef@lfrrwqcofuuf>



On 6/19/24 16:29, Daniel Wagner wrote:
> On Wed, Jun 19, 2024 at 04:16:40PM GMT, Nilay Shroff wrote:
>> +	# start iteration from ns-id 2 because ns-id 1 is created
>> +	# by default when nvme target is setup. Also ns-id 1 is
>> +	# deleted when nvme target is cleaned up.
>> +	for ((i = 2; i <= iterations; i++)); do {
>> +		truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path).$i"
>> +		_create_nvmet_ns "${def_subsysnqn}" "${i}" "$(_nvme_def_file_path).$i"
>> +
>> +		# allow async request to be processed
>> +		sleep 1
> 
> This looks a bit fragile to ensure all request have been processed. Would
> it possible to wait on a state?  E.g. something like
> 
>   nvmf_wait_for_state()
> 
> ?
OK that's a good idea! I think it's possible to wait using _find_nvme_ns() instead 
of using sleep here. We can write a wrapper around _find_nvme_ns() and wait until 
namespace is ready/created.

I will send next patch with the above change. 
> 
>> +
>> +		_remove_nvmet_ns "${def_subsysnqn}" "${i}"
>> +		rm "$(_nvme_def_file_path).$i"
>> +	}
> 

Thanks,
--Nilay


      reply	other threads:[~2024-06-19 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 10:46 [PATCHv3 blktests] nvme: add test for creating/deleting file-ns Nilay Shroff
2024-06-19 10:53 ` Sagi Grimberg
2024-06-19 10:59 ` Daniel Wagner
2024-06-19 17:21   ` Nilay Shroff [this message]

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=9797ab67-e7d1-4624-87bc-9d7cd8406089@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=chaitanyak@nvidia.com \
    --cc=dwagner@suse.de \
    --cc=gjoyce@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sachinp@linux.vnet.ibm.com \
    --cc=sagi@grimberg.me \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=venkat88@linux.vnet.ibm.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