On Thu Nov 12, 2026 at 10:53 AM CET, Klaus Jensen wrote:
> From: Klaus Jensen <[email protected]>
>
> The reclaim unit accounting in nvme_do_write_fdp spins forever if RUNS
> is configured to be smaller than LBADS.
>
> Reject such an invalid configuration upfront.
>
> Link: https://gitlab.com/qemu-project/qemu/-/work_items/4520

/s/Link/Resolves

> Signed-off-by: Klaus Jensen <[email protected]>

Maybe Fixes tag and QEMU stable in cc?

> ---
>  hw/nvme/ns.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c
> index 2ae26a9acbd0..37d45bb4d533 100644
> --- a/hw/nvme/ns.c
> +++ b/hw/nvme/ns.c
> @@ -485,6 +485,12 @@ static bool nvme_ns_init_fdp(NvmeNamespace *ns, Error 
> **errp)
>      char *r, *p;
>      uint16_t *ph;
>  
> +    if (endgrp->fdp.runs < nvme_l2b(ns, 1)) {
> +        error_setg(errp, "fdp.runs must be greater than or equal to the "
> +                   "lba data size of the namespace");
> +        return false;
> +    }
> +
>      if (!ns->params.fdp.ruhs) {
>          ns->fdp.nphs = 1;
>          ph = ns->fdp.phs = g_new(uint16_t, 1);

Thanks,
Tommaso


Reply via email to