Re: [PATCH blktests v1 2/5] nvme/rc: filter out errors from cat when reading files

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

 



On Tue, Feb 06, 2024 at 11:07:06PM +0000, Chaitanya Kulkarni wrote:
> >   	for dev in /sys/class/nvme/nvme*; do
> >   		dev="$(basename "$dev")"
> > -		transport="$(cat "/sys/class/nvme/${dev}/transport")"
> > +		transport="$(cat "/sys/class/nvme/${dev}/transport" 2>/dev/null)"
> 
> do we have to do anything if there is in error ?

In this case transport will be '' and not match with '${nvme_trtype}'.
So we already handle this properly.

> >   		if [[ "$transport" == "${nvme_trtype}" ]]; then
> >   			echo "WARNING: Test did not clean up ${nvme_trtype} device: ${dev}"
> >   			_nvme_disconnect_ctrl "${dev}"
> > @@ -840,7 +840,7 @@ _find_nvme_dev() {
> >   	for dev in /sys/class/nvme/nvme*; do
> >   		[ -e "$dev" ] || continue
> >   		dev="$(basename "$dev")"
> > -		subsysnqn="$(cat "/sys/class/nvme/${dev}/subsysnqn")"
> > +		subsysnqn="$(cat "/sys/class/nvme/${dev}/subsysnqn" 2>/dev/null)"




[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