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 <john.hammond@intel.com>
Change-Id: Ib4f884bf0759b81978336d68fea45cf7a5d8a70f
Reviewed-on: http://review.whamcloud.com/11121
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
/* 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) &&