summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-09-24 21:01:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 08:51:18 -0800
commitb4659d8e7001600f06080f2b3f1922d0f4d96478 (patch)
tree9cd38deb8ad331ed104db77bf95202d7130b13a9 /fs
parenta871375b5548cbcd28c9b97040da7f6470a96a72 (diff)
ceph: propagate layout error on osd request creation
If we are creating an osd request and get an invalid layout, return an EINVAL to the caller. We switch up the return to have an error code instead of NULL implying -ENOMEM. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com> (cherry picked from commit 6816282dab3a72efe8c0d182c1bc2960d87f4322) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/addr.c8
-rw-r--r--fs/ceph/file.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 32ee086c259b..e009fde39cf6 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -308,8 +308,8 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max)
NULL, 0,
ci->i_truncate_seq, ci->i_truncate_size,
NULL, false, 1, 0);
- if (!req)
- return -ENOMEM;
+ if (IS_ERR(req))
+ return PTR_ERR(req);
/* build page vector */
nr_pages = len >> PAGE_CACHE_SHIFT;
@@ -831,8 +831,8 @@ get_more_pages:
ci->i_truncate_size,
&inode->i_mtime, true, 1, 0);
- if (!req) {
- rc = -ENOMEM;
+ if (IS_ERR(req)) {
+ rc = PTR_ERR(req);
unlock_page(page);
break;
}
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index ed72428d9c75..9ce3a4bd4d1c 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -529,8 +529,8 @@ more:
do_sync,
ci->i_truncate_seq, ci->i_truncate_size,
&mtime, false, 2, page_align);
- if (!req)
- return -ENOMEM;
+ if (IS_ERR(req))
+ return PTR_ERR(req);
if (file->f_flags & O_DIRECT) {
pages = ceph_get_direct_page_vector(data, num_pages, false);