fdp: fix placement id check
authorAnkit Kumar <ankit.kumar@samsung.com>
Wed, 12 Jul 2023 10:20:39 +0000 (15:50 +0530)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 13 Jul 2023 16:38:14 +0000 (12:38 -0400)
Number of reclaim unit handle descriptors are 1 based, whereas the
input placement id index / indices are 0 based. Add the correct check
for that.

Fixes: a7e8aae0 ("fio: add fdp support ..")

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
fdp.c

diff --git a/fdp.c b/fdp.c
index b83fd66054c86d2a34b284ab7048e2487a7657c2..6e124ce6005232a6c1838a4cf4edfdd9ceeb2cc0 100644 (file)
--- a/fdp.c
+++ b/fdp.c
@@ -65,7 +65,7 @@ static int init_ruh_info(struct thread_data *td, struct fio_file *f)
        }
 
        for (i = 0; i < td->o.fdp_nrpli; i++) {
-               if (td->o.fdp_plis[i] > ruhs->nr_ruhs) {
+               if (td->o.fdp_plis[i] >= ruhs->nr_ruhs) {
                        ret = -EINVAL;
                        goto out;
                }