Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42497
b: refs/heads/master
c: cf1308f
h: refs/heads/master
i:
  42495: cdaad9d
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 6, 2006
1 parent 50250e7 commit 67d22e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b67130149b006628389ff3e8f46be9957af98aa
refs/heads/master: cf1308ff7829017dab0dbcc817c63dc9c212923e
10 changes: 6 additions & 4 deletions trunk/fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode,
{
unsigned int rsize = NFS_SERVER(inode)->rsize;
unsigned int count = PAGE_CACHE_SIZE;
int result;
int result = -ENOMEM;
struct nfs_read_data *rdata;

rdata = nfs_readdata_alloc(count);
if (!rdata)
return -ENOMEM;
goto out_unlock;

memset(rdata, 0, sizeof(*rdata));
rdata->flags = (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0);
Expand Down Expand Up @@ -218,8 +218,9 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode,
result = 0;

io_error:
unlock_page(page);
nfs_readdata_free(rdata);
out_unlock:
unlock_page(page);
return result;
}

Expand Down Expand Up @@ -630,9 +631,10 @@ int nfs_readpage(struct file *file, struct page *page)
goto out_error;

if (file == NULL) {
error = -EBADF;
ctx = nfs_find_open_context(inode, NULL, FMODE_READ);
if (ctx == NULL)
return -EBADF;
goto out_error;
} else
ctx = get_nfs_open_context((struct nfs_open_context *)
file->private_data);
Expand Down

0 comments on commit 67d22e8

Please sign in to comment.