From: John L. Hammond Date: Wed, 16 Jul 2014 20:35:33 +0000 (-0500) Subject: LU-5352 dt: correct if condition in dt_index_read() X-Git-Tag: 2.6.90~72 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F11121%2F6;p=fs%2Flustre-release.git 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 --- 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) &&