Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer

Keith Busch
2024-12-10T15:23:25Z

On Tue, Dec 10, 2024 at 11:45:43AM +0300, Dan Carpenter wrote:
> 04ca0849938146 Keith Busch 2024-12-06 2226 ret = nvme_submit_sync_cmd(ns->queue, &c, ruhs, size);
> 04ca0849938146 Keith Busch 2024-12-06 2227 if (ret)
> 04ca0849938146 Keith Busch 2024-12-06 2228 goto free;
> 04ca0849938146 Keith Busch 2024-12-06 2229
> 04ca0849938146 Keith Busch 2024-12-06 2230 head->nr_plids = le16_to_cpu(ruhs->nruhsd);
> 04ca0849938146 Keith Busch 2024-12-06 2231 if (!head->nr_plids)
> 04ca0849938146 Keith Busch 2024-12-06 @2232 goto free;
>
> ret = -EINVAL?

It's very much on purpose to return "0" here. Returning a negative error
has the driver fail the namespace disk creation. Seeing a stream
configuration the driver doesn't support just means you don't get to use
the block layer's write stream features. You should still be able to use
your namespace the same as before the driver started checking these
configs, otherwise it's a regression since such namespaces are usable
today.