OBD_ALLOC_GFP(page, cl_object_header(o)->coh_page_bufsize,
CFS_ALLOC_IO);
if (page != NULL) {
- int result;
+ int result = 0;
cfs_atomic_set(&page->cp_ref, 1);
if (type == CPT_CACHEABLE) /* for radix tree */
cfs_atomic_inc(&page->cp_ref);
* PG_writeback without risking other layers deciding to skip this
* page.
*/
+ if (crt >= CRT_NR)
+ return -EINVAL;
result = cl_page_invoke(env, io, pg, CL_PAGE_OP(io[crt].cpo_prep));
if (result == 0)
cl_page_io_start(env, pg, crt);
}
cl_page_state_set(env, pg, CPS_CACHED);
+ if (crt >= CRT_NR)
+ return;
CL_PAGE_INVOID_REVERSE(env, pg, CL_PAGE_OP(io[crt].cpo_completion),
(const struct lu_env *,
const struct cl_page_slice *, int), ioret);
PINVRNT(env, pg, crt < CRT_NR);
ENTRY;
+ if (crt >= CRT_NR)
+ RETURN(-EINVAL);
result = CL_PAGE_INVOKE(env, pg, CL_PAGE_OP(io[crt].cpo_make_ready),
(const struct lu_env *,
const struct cl_page_slice *));
ENTRY;
+ if (crt >= CRT_NR)
+ RETURN(-EINVAL);
+
cfs_list_for_each_entry(scan, &pg->cp_layers, cpl_linkage) {
if (scan->cpl_ops->io[crt].cpo_cache_add == NULL)
continue;