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 ___ devel mailing list de...@linuxdriverproject.org

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 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 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 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 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 3/8] staging: erofs: add error handling for xattr submodule

2018-08-13 Thread Gao Xiang
Hi Dan, On 2018/8/13 19:47, Dan Carpenter wrote: >> -static void xattr_iter_fixup(struct xattr_iter *it) >> +static inline int xattr_iter_fixup(struct xattr_iter *it) >> { >> -if (unlikely(it->ofs >= EROFS_BLKSIZ)) { >> -xattr_iter_end(it, true); >> +if (likely(it->ofs <

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

2018-08-13 Thread Dan Carpenter
> -static void xattr_iter_fixup(struct xattr_iter *it) > +static inline int xattr_iter_fixup(struct xattr_iter *it) > { > - if (unlikely(it->ofs >= EROFS_BLKSIZ)) { > - xattr_iter_end(it, true); > + if (likely(it->ofs < EROFS_BLKSIZ)) > + return 0; > > -

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 3/8] staging: erofs: add error handling for xattr submodule

2018-08-12 Thread Gao Xiang
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. >> >> Signed-off-by: Gao Xiang >> Reviewed-by: Chao Yu >>

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

2018-08-12 Thread Chao Yu
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. > > Signed-off-by: Gao Xiang > Reviewed-by: Chao Yu > Signed-off-by: Chao Yu > --- >

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

2018-08-12 Thread Chao Yu
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 --- drivers/staging/erofs/internal.h | 6 +- drivers/staging/erofs/xattr.c|