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>
This commit is contained in:
@@ -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;
|
||||
@@ -832,8 +832,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user