From 253eda6fcd564d21478658acac6c94ff63251369 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 3 Oct 2002 19:26:02 +0000 Subject: [PATCH] Handle error case when mdc_readpage() fails. --- lustre/llite/dir.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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); -- 1.8.3.1