Commit fe956e72 authored by Swapnil Pimpale's avatar Swapnil Pimpale Committed by Greg Kroah-Hartman

staging: lustre: llite: check ret of ll_prep_md_op_data in ll_dir_filler

ll_dir_filler() now checks the returned pointer from
ll_prep_md_op_data() using IS_ERR()
Signed-off-by: default avatarSwapnil Pimpale <spimpale@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4082
Reviewed-on: http://review.whamcloud.com/8073Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5787be94
...@@ -163,6 +163,11 @@ static int ll_dir_filler(void *_hash, struct page *page0) ...@@ -163,6 +163,11 @@ static int ll_dir_filler(void *_hash, struct page *page0)
LASSERT(max_pages > 0 && max_pages <= MD_MAX_BRW_PAGES); LASSERT(max_pages > 0 && max_pages <= MD_MAX_BRW_PAGES);
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
return PTR_ERR(op_data);
page_pool = kcalloc(max_pages, sizeof(page), GFP_NOFS); page_pool = kcalloc(max_pages, sizeof(page), GFP_NOFS);
if (page_pool) { if (page_pool) {
page_pool[0] = page0; page_pool[0] = page0;
...@@ -177,8 +182,6 @@ static int ll_dir_filler(void *_hash, struct page *page0) ...@@ -177,8 +182,6 @@ static int ll_dir_filler(void *_hash, struct page *page0)
page_pool[npages] = page; page_pool[npages] = page;
} }
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, NULL);
op_data->op_npages = npages; op_data->op_npages = npages;
op_data->op_offset = hash; op_data->op_offset = hash;
rc = md_readpage(exp, op_data, page_pool, &request); rc = md_readpage(exp, op_data, page_pool, &request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment