summaryrefslogtreecommitdiffstats
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-15 22:03:45 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-19 17:54:39 +0200
commit7a52411107e1ac8f5be6967936ec237f40a1c7e4 (patch)
tree155ba22e3d333f7e0f6cf1fcbb3d9538f75375fe /fs/nfs/read.c
parentx86: save/restore eflags in context switch (diff)
downloadlinux-7a52411107e1ac8f5be6967936ec237f40a1c7e4.tar.xz
linux-7a52411107e1ac8f5be6967936ec237f40a1c7e4.zip
NFS: Fix Oopsable condition in nfs_readpage_sync()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/read.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 7a9ee00e0c61..f0aff824a291 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: