From: Trond Myklebust Date: Fri, 15 Sep 2006 20:03:45 +0000 (-0400) Subject: NFS: Fix Oopsable condition in nfs_readpage_sync() X-Git-Tag: v2.6.18~2^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7a52411107e1ac8f5be6967936ec237f40a1c7e4;p=linux-2.6-omap-h63xx.git NFS: Fix Oopsable condition in nfs_readpage_sync() Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 7a9ee00e0c6..f0aff824a29 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -204,9 +204,11 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode, NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; spin_unlock(&inode->i_lock); - nfs_readpage_truncate_uninitialised_page(rdata); - if (rdata->res.eof || rdata->res.count == rdata->args.count) + if (rdata->res.eof || rdata->res.count == rdata->args.count) { SetPageUptodate(page); + if (rdata->res.eof && count != 0) + memclear_highpage_flush(page, rdata->args.pgbase, count); + } result = 0; io_error: