Re: [PATCH v9 07/12] nvmet-core: don't check the data len for pt-ctrl

From: Christoph Hellwig
Date: Thu Oct 10 2019 - 07:04:31 EST


On Wed, Oct 09, 2019 at 01:25:25PM -0600, Logan Gunthorpe wrote:
> From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
>
> Right now, data_len is calculated before the transfer len after we
> parse the command, With passthru interface we allow VUCs (Vendor-Unique
> Commands). In order to make the code simple and compact, instead of
> assigning the data len or each VUC in the command parse function
> just use the transfer len as it is. This may result in error if expected
> data_len != transfer_len.

This is a pretty horrible hack. I think instead we'll need to kill off
the data_len field entirely if we want to go down that route. Something
like the untested patch below:

---