From 9adb4551536e985b0018c6e12298e1be34a3b16a Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 16 Jul 2014 15:35:33 -0500 Subject: [PATCH] LU-5352 dt: correct if condition in dt_index_read() In dt_index_read() return -EPROTO if rdpg->rp_count is zero or is not divisible by LU_PAGE_SIZE. Signed-off-by: John L. Hammond Change-Id: Ib4f884bf0759b81978336d68fea45cf7a5d8a70f Reviewed-on: http://review.whamcloud.com/11121 Reviewed-by: Bob Glossman Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger --- lustre/obdclass/dt_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index 4708a26..d6f82c7 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -889,7 +889,7 @@ int dt_index_read(const struct lu_env *env, struct dt_device *dev, /* rp_count shouldn't be null and should be a multiple of the container * size */ - if (rdpg->rp_count <= 0 && (rdpg->rp_count & (LU_PAGE_SIZE - 1)) != 0) + if (rdpg->rp_count == 0 || (rdpg->rp_count & (LU_PAGE_SIZE - 1)) != 0) RETURN(-EFAULT); if (!fid_is_quota(&ii->ii_fid) && !fid_is_layout_rbtree(&ii->ii_fid) && -- 1.8.3.1