summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorLai Siyao <lai.siyao@intel.com>2015-02-01 21:52:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-07 17:32:34 +0800
commitc67587a74847a27965ca1c6a4362c3b39e9943e1 (patch)
treee808c2718ab3c064ec378d0f194b0e465eefd1a0 /drivers/staging
parent437dfb201a55ff73954ae7455ef3d17be4b1c0f6 (diff)
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: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5461 Reviewed-on: http://review.whamcloud.com/11450 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/lustre/lustre/llite/dir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 69a4a63e1d8f..a18201913273 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -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);