diff options
author | Peng Tao <bergwolf@gmail.com> | 2011-07-15 03:33:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-15 09:11:28 -0400 |
commit | 3b6091846d5b6113d695c79caec7cc96b62d469b (patch) | |
tree | ab842567b2afacfe019408277de88f97bf000562 /fs/nfs | |
parent | 6e4efd568574221840ee8dd86f176dc977c1330c (diff) |
NFS: fix return value of nfs_pagein_one/nfs_flush_one
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/read.c | 3 | ||||
-rw-r--r-- | fs/nfs/write.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 248a55425853..581534a4aed7 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -351,12 +351,13 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc) | |||
351 | struct nfs_read_data *data; | 351 | struct nfs_read_data *data; |
352 | struct list_head *head = &desc->pg_list; | 352 | struct list_head *head = &desc->pg_list; |
353 | struct pnfs_layout_segment *lseg = desc->pg_lseg; | 353 | struct pnfs_layout_segment *lseg = desc->pg_lseg; |
354 | int ret = -ENOMEM; | 354 | int ret = 0; |
355 | 355 | ||
356 | data = nfs_readdata_alloc(nfs_page_array_len(desc->pg_base, | 356 | data = nfs_readdata_alloc(nfs_page_array_len(desc->pg_base, |
357 | desc->pg_count)); | 357 | desc->pg_count)); |
358 | if (!data) { | 358 | if (!data) { |
359 | nfs_async_read_error(head); | 359 | nfs_async_read_error(head); |
360 | ret = -ENOMEM; | ||
360 | goto out; | 361 | goto out; |
361 | } | 362 | } |
362 | 363 | ||
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 0aeb09b38e4b..d9dd744588d4 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1006,7 +1006,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc) | |||
1006 | struct nfs_write_data *data; | 1006 | struct nfs_write_data *data; |
1007 | struct list_head *head = &desc->pg_list; | 1007 | struct list_head *head = &desc->pg_list; |
1008 | struct pnfs_layout_segment *lseg = desc->pg_lseg; | 1008 | struct pnfs_layout_segment *lseg = desc->pg_lseg; |
1009 | int ret; | 1009 | int ret = 0; |
1010 | 1010 | ||
1011 | data = nfs_writedata_alloc(nfs_page_array_len(desc->pg_base, | 1011 | data = nfs_writedata_alloc(nfs_page_array_len(desc->pg_base, |
1012 | desc->pg_count)); | 1012 | desc->pg_count)); |