[PATCH RESEND] staging: erofs: remove unsupported ->datamode check in fill_inline_data()
From: Yue Hu Already check if ->datamode is supported in read_inode(), no need to check again in the next fill_inline_data() only called by fill_inode(). Signed-off-by: Yue Hu --- drivers/staging/erofs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index e51348f..d6e1e16 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -129,8 +129,6 @@ static int fill_inline_data(struct inode *inode, void *data, struct erofs_sb_info *sbi = EROFS_I_SB(inode); const int mode = vi->datamode; - DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); - /* should be inode inline C */ if (mode != EROFS_INODE_LAYOUT_INLINE) return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND] staging: erofs: return the error value if fill_inline_data() fails
From: Yue Hu 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 --- drivers/staging/erofs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index d6e1e16..1433f25 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -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: -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND] staging: erofs: remove unsupported ->datamode check in fill_inline_data()
From: Yue Hu Already check if ->datamode is supported in read_inode(), no need to check again in the next fill_inline_data() only called by fill_inode(). Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu --- drivers/staging/erofs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index e51348f..d6e1e16 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -129,8 +129,6 @@ static int fill_inline_data(struct inode *inode, void *data, struct erofs_sb_info *sbi = EROFS_I_SB(inode); const int mode = vi->datamode; - DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); - /* should be inode inline C */ if (mode != EROFS_INODE_LAYOUT_INLINE) return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND v2] staging: erofs: remove unsupported ->datamode check in fill_inline_data()
From: Yue Hu Already check if ->datamode is supported in read_inode(), no need to check again in the next fill_inline_data() only called by fill_inode(). Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu --- v2: add tags. drivers/staging/erofs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index e51348f..d6e1e16 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -129,8 +129,6 @@ static int fill_inline_data(struct inode *inode, void *data, struct erofs_sb_info *sbi = EROFS_I_SB(inode); const int mode = vi->datamode; - DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); - /* should be inode inline C */ if (mode != EROFS_INODE_LAYOUT_INLINE) return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND v2] staging: erofs: return the error value if fill_inline_data() fails
From: Yue Hu 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 Reviewed-by: Gao Xiang Reviewed-by: Chao Yu --- no change drivers/staging/erofs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index d6e1e16..1433f25 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -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: -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: erofs: don't check special inode layout
From: Yue Hu Currently, we will check if inode layout is compression or inline if the inode is special in fill_inode(). Also set ->i_mapping->a_ops for it. That is pointless since the both modes won't be set for special inode when creating EROFS filesystem image. So, let's avoid it. Signed-off-by: Yue Hu --- drivers/staging/erofs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index 1433f25..2fe0f6d 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -205,6 +205,7 @@ static int fill_inode(struct inode *inode, int isdir) S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) { inode->i_op = &erofs_generic_iops; init_special_inode(inode, inode->i_mode, inode->i_rdev); + goto out_unlock; } else { err = -EIO; goto out_unlock; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: erofs: don't check special inode layout
On Fri, 28 Jun 2019 11:50:21 +0800 Gao Xiang wrote: > Hi Yue, > > On 2019/6/28 11:42, Yue Hu wrote: > > From: Yue Hu > > > > Currently, we will check if inode layout is compression or inline if > > the inode is special in fill_inode(). Also set ->i_mapping->a_ops for > > it. That is pointless since the both modes won't be set for special > > inode when creating EROFS filesystem image. So, let's avoid it. > > > > Signed-off-by: Yue Hu > > Have you test this patch with some actual image with legacy mkfs since > new mkfs framework have not supported special inode... Hi Xiang, I'm studying the testing :) However, already check the code handling for special inode in leagcy mkfs as below: ```c break; case EROFS_FT_BLKDEV: case EROFS_FT_CHRDEV: case EROFS_FT_FIFO: case EROFS_FT_SOCK: mkfs_rank_inode(d); break; default: erofs_err("inode[%s] file_type error =%d", d->i_fullpath, ``` No special inode layout operations, so this change should be fine. Thx. > > I think that is fine in priciple, however, in case to introduce some potential > issues, I will test this patch later. I will give a Reviewed-by tag after I > tested > this patch. Thanks. > > Thanks, > Gao Xiang > > > --- > > drivers/staging/erofs/inode.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c > > index 1433f25..2fe0f6d 100644 > > --- a/drivers/staging/erofs/inode.c > > +++ b/drivers/staging/erofs/inode.c > > @@ -205,6 +205,7 @@ static int fill_inode(struct inode *inode, int isdir) > > S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) { > > inode->i_op = &erofs_generic_iops; > > init_special_inode(inode, inode->i_mode, inode->i_rdev); > > + goto out_unlock; > > } else { > > err = -EIO; > > goto out_unlock; > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND v3] staging: erofs: remove unsupported ->datamode check in fill_inline_data()
From: Yue Hu Already check if ->datamode is supported in read_inode(), no need to check again in the next fill_inline_data() only called by fill_inode(). Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu --- no change drivers/staging/erofs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index e51348f..d6e1e16 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -129,8 +129,6 @@ static int fill_inline_data(struct inode *inode, void *data, struct erofs_sb_info *sbi = EROFS_I_SB(inode); const int mode = vi->datamode; - DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); - /* should be inode inline C */ if (mode != EROFS_INODE_LAYOUT_INLINE) return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RESEND v3] staging: erofs: remove unsupported ->datamode check in fill_inline_data()
On Wed, 3 Jul 2019 18:20:38 +0200 Greg KH wrote: > On Tue, Jul 02, 2019 at 10:56:01AM +0800, Yue Hu wrote: > > From: Yue Hu > > > > Already check if ->datamode is supported in read_inode(), no need to check > > again in the next fill_inline_data() only called by fill_inode(). > > > > Signed-off-by: Yue Hu > > Reviewed-by: Gao Xiang > > Reviewed-by: Chao Yu > > --- > > no change > > > > drivers/staging/erofs/inode.c | 2 -- > > 1 file changed, 2 deletions(-) > > This is already in my tree, right? Seems not, i have received notes about other 2 patches below mergerd: ```note1 This is a note to let you know that I've just added the patch titled staging: erofs: don't check special inode layout to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-next branch. ``` ```note2 This is a note to let you know that I've just added the patch titled staging: erofs: return the error value if fill_inline_data() fails to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-next branch. ``` No this patch in below link checked: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/log/drivers/staging/erofs?h=staging-testing Thanks. > > confused, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RESEND v3] staging: erofs: remove unsupported ->datamode check in fill_inline_data()
On Thu, 4 Jul 2019 07:26:49 +0200 Greg KH wrote: > On Thu, Jul 04, 2019 at 09:59:03AM +0800, Yue Hu wrote: > > On Wed, 3 Jul 2019 18:20:38 +0200 > > Greg KH wrote: > > > > > On Tue, Jul 02, 2019 at 10:56:01AM +0800, Yue Hu wrote: > > > > From: Yue Hu > > > > > > > > Already check if ->datamode is supported in read_inode(), no need to > > > > check > > > > again in the next fill_inline_data() only called by fill_inode(). > > > > > > > > Signed-off-by: Yue Hu > > > > Reviewed-by: Gao Xiang > > > > Reviewed-by: Chao Yu > > > > --- > > > > no change > > > > > > > > drivers/staging/erofs/inode.c | 2 -- > > > > 1 file changed, 2 deletions(-) > > > > > > This is already in my tree, right? > > > > Seems not, i have received notes about other 2 patches below mergerd: > > > > ```note1 > > This is a note to let you know that I've just added the patch titled > > > > staging: erofs: don't check special inode layout > > > > to my staging git tree which can be found at > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > > in the staging-next branch. > > ``` > > > > ```note2 > > This is a note to let you know that I've just added the patch titled > > > > staging: erofs: return the error value if fill_inline_data() fails > > > > to my staging git tree which can be found at > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > > in the staging-next branch. > > ``` > > > > No this patch in below link checked: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/log/drivers/staging/erofs?h=staging-testing > > > > Then if it is not present, it needs to be rebased as it does not apply. > > Please do so and resend it. Hm, no need to resend since it's included in another patch below. ec8c244 staging: erofs: add compacted ondisk compression indexes. Thanks. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel