Skip to content

Commit

Permalink
NFS: Fix Oopsable condition in nfs_readpage_sync()
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 19, 2006
1 parent 47a5c6f commit 7a52411
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7a52411

Please sign in to comment.