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() ? > + > + _remove_nvmet_ns "${def_subsysnqn}" "${i}" > + rm "$(_nvme_def_file_path).$i" > + }