]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: erofs: return the error value if fill_inline_data() fails
authorYue Hu <huyue2@yulong.com>
Thu, 27 Jun 2019 09:46:15 +0000 (17:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jul 2019 06:45:00 +0000 (08:45 +0200)
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>
drivers/staging/erofs/inode.c

index 1d467322bacf80d078f5a1f4019ce1712f8a0071..35fc5987185ef41e2b9dd91f3f34f9f613234d44 100644 (file)
@@ -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: