[PREVIEW] [PATCH v2 staging-next 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch enhances the missing error handling code for xattr submodule, which improves the stability for the rare cases. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Chao Yu --- change log v2: - fix as pointed out by Dan Carpenter : 1) drop all

[PREVIEW] [PATCH RESEND staging-next 4/8] staging: erofs: cleanup z_erofs_vle_work_{lookup, register}

2018-08-13 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch introduces 'struct z_erofs_vle_work_finder' to clean up arguments of z_erofs_vle_work_lookup and z_erofs_vle_work_register. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Chao Yu --- drivers/staging/erofs/unzip_vle.c | 89

[PREVIEW] [PATCH v3 staging-next 2/8] staging: erofs: separate erofs_get_meta_page

2018-08-13 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch separates 'erofs_get_meta_page' into 'erofs_get_meta_page' and 'erofs_get_meta_page_nofail'. The second one ensures that it should not fail under memory pressure and should make best efforts if IO errors occur. It also adds auxiliary variables in order to fulfill 80

[PREVIEW] [PATCH RESEND staging-next 1/8] staging: erofs: introduce erofs_grab_bio

2018-08-13 Thread Gao Xiang via Linux-erofs
From: Gao Xiang this patch renames prepare_bio to erofs_grab_bio, and adds a nofail option in order to retry in the bio allocator under memory pressure. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Chao Yu --- drivers/staging/erofs/data.c | 12 ++--

Re: [PATCH 2/8] staging: erofs: separate erofs_get_meta_page

2018-08-13 Thread Dan Carpenter
On Sun, Aug 12, 2018 at 10:01:44PM +0800, Chao Yu wrote: > --- a/drivers/staging/erofs/data.c > +++ b/drivers/staging/erofs/data.c > @@ -39,31 +39,44 @@ static inline void read_endio(struct bio *bio) > } > > /* prio -- true is used for dir */ > -struct page *erofs_get_meta_page(struct

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Chao Yu
Hi Xiang, On 2018/8/13 10:36, Gao Xiang wrote: > Hi Chao, > > On 2018/8/13 10:00, Chao Yu wrote: >> On 2018/8/12 22:01, Chao Yu wrote: >>> From: Gao Xiang >>> >>> This patch enhances the missing error handling code for >>> xattr submodule, which improves the stability for the rare cases. >>>

Re: [PATCH 6/8] staging: erofs: fix vle_decompressed_index_clusterofs

2018-08-13 Thread Dan Carpenter
> -static inline unsigned > -vle_compressed_index_clusterofs(unsigned clustersize, > - struct z_erofs_vle_decompressed_index *di) > +static inline int > +vle_decompressed_index_clusterofs(unsigned int *clusterofs, Not related to your patch, but don't make functions inline. Leave it to the

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Chao Yu
On 2018/8/13 20:17, Gao Xiang wrote: >> Generally the rule on likely/unlikely is that they hurt readability so >> we should only add them if it makes a difference in benchmarking. >> > > In my opinion, return values other than 0 and ENOATTR(ENODATA) rarely happens, > it should be in the slow

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Gao Xiang
Hi Dan, On 2018/8/13 20:40, Dan Carpenter wrote: > On Mon, Aug 13, 2018 at 08:17:27PM +0800, Gao Xiang wrote: @@ -294,8 +322,11 @@ static int inline_getxattr(struct inode *inode, struct getxattr_iter *it) ret = xattr_foreach(>it, _xattr_handlers, ); if

Re: [PATCH 6/8] staging: erofs: fix vle_decompressed_index_clusterofs

2018-08-13 Thread Gao Xiang
Hi Dan, On 2018/8/13 20:03, Dan Carpenter wrote: >> -static inline unsigned >> -vle_compressed_index_clusterofs(unsigned clustersize, >> -struct z_erofs_vle_decompressed_index *di) >> +static inline int >> +vle_decompressed_index_clusterofs(unsigned int *clusterofs, > > Not related to your

Re: [PATCH 4/8] staging: erofs: cleanup z_erofs_vle_work_{lookup, register}

2018-08-13 Thread Dan Carpenter
On Sun, Aug 12, 2018 at 10:01:46PM +0800, Chao Yu wrote: > From: Gao Xiang > > This patch introduces 'struct z_erofs_vle_work_finder' to clean up > arguments of z_erofs_vle_work_lookup and z_erofs_vle_work_register. > > Signed-off-by: Gao Xiang > Reviewed-by: Chao Yu > Signed-off-by: Chao Yu

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Dan Carpenter
On Mon, Aug 13, 2018 at 08:17:27PM +0800, Gao Xiang wrote: > > /* we assume that ofs is aligned with 4 bytes */ > > it->ofs = EROFS_XATTR_ALIGN(it->ofs); > > return err; > > This might be cleaner if we wrote: return (err < 0) ? error : 0; The callers all treate zero and one

Re: [PATCH] staging: erofs: add int to usigned

2018-08-13 Thread Gao Xiang
Hi Leon, On 2018/8/13 20:09, Leon Imhof wrote: > Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'" > detected by checkpatch.pl > > Signed-off-by: Leon Imhof Looks fine, Reviewed-by: Gao Xiang (BTW, could you fix the title of this commit? Thanks.) > --- >

Re: [PATCH 4/8] staging: erofs: cleanup z_erofs_vle_work_{lookup, register}

2018-08-13 Thread Gao Xiang
Hi Dan, On 2018/8/13 21:05, Dan Carpenter wrote: > Yeah. You'd have to remove the const. > > Anyway, on looking at it more, I guess this patch is fine for now. We > will probably end up changing z_erofs_vle_work_lookup() and > z_erofs_vle_work_register() some more in the future. > Thanks for

Re: [PATCH 2/8] staging: erofs: separate erofs_get_meta_page

2018-08-13 Thread Gao Xiang
Hi Dan, On 2018/8/13 19:04, Dan Carpenter wrote: > On Sun, Aug 12, 2018 at 10:01:44PM +0800, Chao Yu wrote: >> --- a/drivers/staging/erofs/data.c >> +++ b/drivers/staging/erofs/data.c >> @@ -39,31 +39,44 @@ static inline void read_endio(struct bio *bio) >> } >> >> /* prio -- true is used for

[PATCH] staging: erofs: add int to usigned

2018-08-13 Thread Leon Imhof
Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'" detected by checkpatch.pl Signed-off-by: Leon Imhof --- drivers/staging/erofs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c index

Re: [PATCH 2/8] staging: erofs: separate erofs_get_meta_page

2018-08-13 Thread Chao Yu
On 2018/8/13 19:04, Dan Carpenter wrote: > On Sun, Aug 12, 2018 at 10:01:44PM +0800, Chao Yu wrote: >> --- a/drivers/staging/erofs/data.c >> +++ b/drivers/staging/erofs/data.c >> @@ -39,31 +39,44 @@ static inline void read_endio(struct bio *bio) >> } >> >> /* prio -- true is used for dir */ >>

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Dan Carpenter
On Mon, Aug 13, 2018 at 08:17:27PM +0800, Gao Xiang wrote: > >> @@ -294,8 +322,11 @@ static int inline_getxattr(struct inode *inode, > >> struct getxattr_iter *it) > >>ret = xattr_foreach(>it, _xattr_handlers, ); > >>if (ret >= 0) > >>break; > >> + > >>

Re: [PATCH 4/8] staging: erofs: cleanup z_erofs_vle_work_{lookup, register}

2018-08-13 Thread Dan Carpenter
Yeah. You'd have to remove the const. Anyway, on looking at it more, I guess this patch is fine for now. We will probably end up changing z_erofs_vle_work_lookup() and z_erofs_vle_work_register() some more in the future. regards, dan carpenter

[PATCH] staging: erofs: change 'unsigned' to 'unsigned int'

2018-08-13 Thread Leon Imhof
Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'" detected by checkpatch.pl Signed-off-by: Leon Imhof --- drivers/staging/erofs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c index

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Gao Xiang
Hi Dan, On 2018/8/13 20:25, Dan Carpenter wrote: > On Mon, Aug 13, 2018 at 08:17:27PM +0800, Gao Xiang wrote: >>> /* we assume that ofs is aligned with 4 bytes */ >>> it->ofs = EROFS_XATTR_ALIGN(it->ofs); >>> return err; >>> > This might be cleaner if we wrote: > > return (err

Re: [PATCH 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Dan Carpenter
> But it is better to fix them in an independent patch. :) Yah. Of course. This was completely unrelated. regards, dan carpenter