From: adilger Date: Thu, 3 Oct 2002 19:26:02 +0000 (+0000) Subject: Handle error case when mdc_readpage() fails. X-Git-Tag: 0.5.14~82 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=253eda6fcd564d21478658acac6c94ff63251369;p=fs%2Flustre-release.git Handle error case when mdc_readpage() fails. --- diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 456f6f1..892a45d 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -95,16 +95,18 @@ static int ll_dir_readpage(struct file *file, struct page *page) rc = mdc_readpage(&sbi->ll_mdc_conn, inode->i_ino, S_IFDIR, offset, buf, &request); kunmap(page); - body = lustre_msg_buf(request->rq_repmsg, 0); - if (!body) - rc = -EINVAL; - if (body) - inode->i_size = body->size; + if (!rc) { + body = lustre_msg_buf(request->rq_repmsg, 0); + if (!body) + rc = -EINVAL; + else + inode->i_size = body->size; + } ptlrpc_free_req(request); EXIT; readpage_out: - if ( !rc ) + if (!rc) SetPageUptodate(page); UnlockPage(page);