[PATCH blktests 09/15] nvme: check for controller device in _nvme_connect_subsys()

Shinichiro Kawasaki shinichiro.kawasaki at wdc.com
Sun Oct 27 23:39:59 PDT 2024


On Oct 25, 2024 / 16:40, Daniel Wagner wrote:
> On Thu, Oct 24, 2024 at 10:00:19AM GMT, Shin'ichiro Kawasaki wrote:
[...]
> > @@ -408,21 +411,17 @@ _nvme_disconnect_subsys() {
> >  }
> >  
> >  
> > -_nvme_ns_ready() {
> > -	local subsysnqn="${1}"
> > -	local ns_path ns_id dev
> > -	local cfs_path="${NVMET_CFS}/subsystems/$subsysnqn"
> > +_nvme_ctrl_ready() {
> > +	local ctrldev="${1}"
> > +	local subsysnqn="${2:-$def_subsysnqn}"
> > +	local ctrlpath="/sys/class/nvme/${ctrldev}"
> >  
> > -	dev=$(_find_nvme_dev "$subsysnqn")
> > -	for ns_path in "${cfs_path}/namespaces/"*; do
> > -		ns_id=${ns_path##*/}
> > -		if [[ ! -b /dev/${dev}n${ns_id} ||
> > -			   ! -e /sys/block/${dev}n${ns_id}/uuid ||
> > -			   ! -e /sys/block/${dev}n${ns_id}/wwid ]]; then
> > -			return 1
> 
> IIRC, the uuid/wwid test were originally from nvme/004 and copied to the
> other test. When we refactored we moved the uuid/wwid here. I suggest we
> add this part back to nvme/004 so that we don't loose this test case.

I checked the history the uuid/wwid test here, and it does not look originated
from nvme/004:

 8251c724 ... Ofar moved it from tests/nvme/rc to common/nvme
 8fc8eb14 ... Shin'ichiro turned the test into _nvme_ns_ready()
 c766fccf ... Bart introduced the test

I guess the uuid/wwid test Daniel mentions is in the _check_uuid() helper
function, and it has different story.


More information about the Linux-nvme mailing list