lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lfr3tkzz3sqnsw4y7sqyxc42ptvzkyfqfpeko6gzs42jdgjl2d@u5fbzjksbztd>
Date:   Wed, 16 Aug 2023 11:28:44 +0200
From:   Daniel Wagner <dwagner@...e.de>
To:     Sagi Grimberg <sagi@...mberg.me>
Cc:     linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org, Chaitanya Kulkarni <kch@...dia.com>,
        Shin'ichiro Kawasaki <shinichiro.kawasaki@....com>,
        Max Gurtovoy <mgurtovoy@...dia.com>,
        Hannes Reinecke <hare@...e.de>,
        James Smart <jsmart2021@...il.com>,
        Bart Van Assche <bvanassche@....org>
Subject: Re: [PATCH blktests v3 13/13] nvme: Introduce
 nvmet_target_{setup/cleanup} common code

On Sun, Aug 13, 2023 at 05:55:48PM +0300, Sagi Grimberg wrote:
> > --- a/tests/nvme/003
> > +++ b/tests/nvme/003
> > @@ -22,15 +22,9 @@ test() {
> >   	_setup_nvmet
> > -	local loop_dev
> >   	local port
> > -	port="$(_create_nvmet_port "${nvme_trtype}")"
> > -
> > -	loop_dev="$(losetup -f)"
> > -
> > -	_create_nvmet_subsystem "${def_subsysnqn}" "${loop_dev}"
> > -	_add_nvmet_subsys_to_port "${port}" "${def_subsysnqn}"
> > +	port="$(_nvmet_target_setup --blkdev=device)"
> >   	_nvme_connect_subsys "${nvme_trtype}" nqn.2014-08.org.nvmexpress.discovery
> > @@ -46,9 +40,8 @@ test() {
> >   	fi
> >   	_nvme_disconnect_subsys nqn.2014-08.org.nvmexpress.discovery
> > -	_remove_nvmet_subsystem_from_port "${port}" "${def_subsysnqn}"
> > -	_remove_nvmet_subsystem "${def_subsysnqn}"
> > -	_remove_nvmet_port "${port}"
> > +
> > +	_nvmet_target_cleanup "${port}"
> 
> It is very very strange that _setup returns a port
> which is passed to _cleanup...

This is the only information the _cleanup helper needs and that is why
it survived the refactoring so far.

> I think that _cleanup should simply remove all
> ports, and that setup should not return a port
> to begin with.

This assumes that blktests is the single user and can blindly remove
everything. I would like to play nice here and only cleanup resources
blktests actually allocates.

> If someone needs the actual port number, then it
> should either not use this _setup helper or
> query it somehow.

I try to figure out how to implement such a query helper then.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ