Commit c67587a7 authored by Lai Siyao's avatar Lai Siyao Committed by Greg Kroah-Hartman

staging/lustre/llite: don't add to page cache upon failure

Reading directory pages may fail on MDS, in this case client should
not cache a non-up-to-date directory page, because it will cause
a later read on the same page fail.
Signed-off-by: default avatarLai Siyao <lai.siyao@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5461
Reviewed-on: http://review.whamcloud.com/11450Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 437dfb20
......@@ -183,7 +183,10 @@ static int ll_dir_filler(void *_hash, struct page *page0)
op_data->op_offset = hash;
rc = md_readpage(exp, op_data, page_pool, &request);
ll_finish_md_op_data(op_data);
if (rc == 0) {
if (rc < 0) {
/* page0 is special, which was added into page cache early */
delete_from_page_cache(page0);
} else if (rc == 0) {
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
/* Checked by mdc_readpage() */
LASSERT(body != NULL);
......
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