Re: [PATCH v3 2/7] nvme: consolidate some nvme-cli utility functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2020-08-11 3:00 p.m., Sagi Grimberg wrote:
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 320aa4b2b475..6d57cf591300 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -64,7 +64,7 @@ _cleanup_nvmet() {
>  		transport="$(cat "/sys/class/nvme/${dev}/transport")"
>  		if [[ "$transport" == "loop" ]]; then
>  			echo "WARNING: Test did not clean up loop device: ${dev}"
> -			nvme disconnect -d "${dev}"
> +			_nvme_disconnect_ctrl "${dev}"
>  		fi
>  	done
>  
> @@ -97,6 +97,33 @@ _setup_nvmet() {
>  	modprobe nvme-loop
>  }
>  
> +_nvme_disconnect_ctrl() {
> +	local ctrl="$1"
> +
> +	nvme disconnect -d ${ctrl}

We're missing some quotes here and in many other places in this
patchset. Have you run shellcheck on this? I'd expect it to complain
about these.

> +}
> +
> +_nvme_disconnect_subsys() {
> +	local subsysnqn="$1"
> +
> +	nvme disconnect -n ${subsysnqn}
> +}
> +
> +_nvme_connect_subsys() {
> +	local trtype="$1"
> +	local subsysnqn="$2"
> +
> +	cmd="nvme connect -t ${trtype} -n ${subsysnqn}"
> +	eval $cmd

Why eval? It makes the quoting here questionable...


Logan



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux