summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYue Hu <huyue2@yulong.com>2019-06-27 17:46:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-01 08:45:00 +0200
commit5545745930ea42a04edff1d260d8084a26feae34 (patch)
tree55103e7bc679d795a72a48800ca0b203e5ca0329
parentfbd6b25009ac76b2034168cd21d5e01f8c2d83d1 (diff)
downloadlinux-5545745930ea42a04edff1d260d8084a26feae34.tar.bz2
staging: erofs: return the error value if fill_inline_data() fails
We should consider the error returned by fill_inline_data() when filling last page in fill_inode(). If not getting inode will be successful even though last page is bad. That is illogical. Also change -EAGAIN to 0 in fill_inline_data() to stand for successful filling. Signed-off-by: Yue Hu <huyue2@yulong.com> Reviewed-by: Gao Xiang <gaoxiang25@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/erofs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
index 1d467322bacf..35fc5987185e 100644
--- a/drivers/staging/erofs/inode.c
+++ b/drivers/staging/erofs/inode.c
@@ -155,7 +155,7 @@ static int fill_inline_data(struct inode *inode, void *data,
inode->i_link = lnk;
set_inode_fast_symlink(inode);
}
- return -EAGAIN;
+ return 0;
}
static int fill_inode(struct inode *inode, int isdir)
@@ -217,7 +217,7 @@ static int fill_inode(struct inode *inode, int isdir)
inode->i_mapping->a_ops = &erofs_raw_access_aops;
/* fill last page if inline data is available */
- fill_inline_data(inode, data, ofs);
+ err = fill_inline_data(inode, data, ofs);
}
out_unlock: