Skip to contentSkip to conversation

staging: erofs: return the error value if fill_inline_data() fails

PATCH New Yue Hu 3 participants 4 messages Jun 25, 2019 – Jun 26, 2019 Staging

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH 1/1 staging: erofs: return the error value if fill_inline_data() fails

From: Yue Hu <[email protected]>

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 at yulong.com>
---
 drivers/staging/erofs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/erofs/inode.c +2 -2
index d6e1e16..1433f25 100644
@@ -156,7 +156,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)
@@ -223,7 +223,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:
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 staging: erofs: return the error value if fill_inline_data() fails

On 2019/6/25 ????3:59, Yue Hu Wrote:

Quoted 8 lines

From: Yue Hu <huyue2 at yulong.com>

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 at yulong.com>

looks good to me, yet I think you need to Cc staging mailing list at least if you want to upstream quickly (including your older patches...)

Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>

(Don't forget to add 'PATCH RESEND' tag at the subject line if you resend these patches.)

Thanks,
Gao Xiang

Quoted 27 lines
---
 drivers/staging/erofs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/erofs/inode.c +2 -2
index d6e1e16..1433f25 100644
@@ -156,7 +156,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)
@@ -223,7 +223,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:
author
#2 lore raw

PATCH 1/1 staging: erofs: return the error value if fill_inline_data() fails

Quoted 14 lines · On Tue, 25 Jun 2019 17:19:36 +0800 Gao Xiang <[email protected]> wrote:

On 2019/6/25 ????3:59, Yue Hu Wrote:

Quoted 8 lines

From: Yue Hu <huyue2 at yulong.com>

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 at yulong.com>

looks good to me, yet I think you need to Cc staging mailing list at least if you want to upstream quickly (including your older patches...)

Quoted 5 lines
Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>

(Don't forget to add 'PATCH RESEND' tag at the subject line if you resend these patches.)

Ok, got it.

Thx.

Quoted 32 lines

Thanks,
Gao Xiang

Quoted 27 lines
---
 drivers/staging/erofs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/erofs/inode.c +2 -2
index d6e1e16..1433f25 100644
@@ -156,7 +156,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)
@@ -223,7 +223,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:
maintainer
#3 lore raw

PATCH 1/1 staging: erofs: return the error value if fill_inline_data() fails

Quoted 17 lines · Yue Hu
Quoted 14 lines · On Tue, 25 Jun 2019 17:19:36 +0800 Gao Xiang <[email protected]> wrote:

On 2019/6/25 ????3:59, Yue Hu Wrote:

Quoted 8 lines

From: Yue Hu <huyue2 at yulong.com>

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 at yulong.com>

looks good to me, yet I think you need to Cc staging mailing list at least if you want to upstream quickly (including your older patches...)

Quoted 7 lines
Quoted 5 lines
Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>

(Don't forget to add 'PATCH RESEND' tag at the subject line if you resend these patches.)

Ok, got it.

Yes, please resend all of these patches as I am not quite sure which ones are the "latest".

thanks,

greg k-h