Commit 3b609184 authored by Peng Tao's avatar Peng Tao Committed by Trond Myklebust

NFS: fix return value of nfs_pagein_one/nfs_flush_one

Signed-off-by: default avatarPeng Tao <peng_tao@emc.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 6e4efd56
...@@ -351,12 +351,13 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc) ...@@ -351,12 +351,13 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc)
struct nfs_read_data *data; struct nfs_read_data *data;
struct list_head *head = &desc->pg_list; struct list_head *head = &desc->pg_list;
struct pnfs_layout_segment *lseg = desc->pg_lseg; struct pnfs_layout_segment *lseg = desc->pg_lseg;
int ret = -ENOMEM; int ret = 0;
data = nfs_readdata_alloc(nfs_page_array_len(desc->pg_base, data = nfs_readdata_alloc(nfs_page_array_len(desc->pg_base,
desc->pg_count)); desc->pg_count));
if (!data) { if (!data) {
nfs_async_read_error(head); nfs_async_read_error(head);
ret = -ENOMEM;
goto out; goto out;
} }
......
...@@ -1006,7 +1006,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc) ...@@ -1006,7 +1006,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc)
struct nfs_write_data *data; struct nfs_write_data *data;
struct list_head *head = &desc->pg_list; struct list_head *head = &desc->pg_list;
struct pnfs_layout_segment *lseg = desc->pg_lseg; struct pnfs_layout_segment *lseg = desc->pg_lseg;
int ret; int ret = 0;
data = nfs_writedata_alloc(nfs_page_array_len(desc->pg_base, data = nfs_writedata_alloc(nfs_page_array_len(desc->pg_base,
desc->pg_count)); desc->pg_count));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment