diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-29 11:38:15 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-29 12:12:26 -0400 |
commit | c1109558ae0f07a3434357cd26203bfc7adfea75 (patch) | |
tree | 80e443d1c539933a99a05733b18a2937c7a25c1f /fs/nfs/pagelist.c | |
parent | c6c8fe79a83e1a03e5dd83d0bac178d6ba5ef30a (diff) |
NFS: Fix error handling in __nfs_pageio_add_request
Handle the case where nfs_create_request() returns an error.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index fab78d13ee14..0b8446f1008d 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -947,6 +947,8 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, | |||
947 | subreq = nfs_create_request(req->wb_context, | 947 | subreq = nfs_create_request(req->wb_context, |
948 | req->wb_page, | 948 | req->wb_page, |
949 | subreq, pgbase, bytes_left); | 949 | subreq, pgbase, bytes_left); |
950 | if (IS_ERR(subreq)) | ||
951 | goto err_ptr; | ||
950 | nfs_lock_request(subreq); | 952 | nfs_lock_request(subreq); |
951 | subreq->wb_offset = offset; | 953 | subreq->wb_offset = offset; |
952 | subreq->wb_index = req->wb_index; | 954 | subreq->wb_index = req->wb_index; |
@@ -955,6 +957,10 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, | |||
955 | 957 | ||
956 | nfs_page_group_unlock(req); | 958 | nfs_page_group_unlock(req); |
957 | return 1; | 959 | return 1; |
960 | err_ptr: | ||
961 | desc->pg_error = PTR_ERR(subreq); | ||
962 | nfs_page_group_unlock(req); | ||
963 | return 0; | ||
958 | } | 964 | } |
959 | 965 | ||
960 | static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc) | 966 | static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc) |