[PATCH 6/6] staging: erofs: simplify return value of `xattr_foreach'

2018-09-18 Thread Gao Xiang
As Dan Carpenter pointed out, there is no need to propagate positive return values back to its callers. Suggested-by: Dan Carpenter Signed-off-by: Gao Xiang --- drivers/staging/erofs/xattr.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git

[PATCH 5/6] staging: erofs: add some comments for xattr subsystem

2018-09-18 Thread Gao Xiang
As Dan Carpenter pointed out, it is better to document what return values of these callbacks in `struct xattr_iter_handlers' mean and why it->ofs is increased regardless of success or failure in `xattr_foreach'. Suggested-by: Dan Carpenter Signed-off-by: Gao Xiang ---

[PATCH 4/6] staging: erofs: cleanup `z_erofs_vle_normalaccess_readpages'

2018-09-18 Thread Gao Xiang
This patch introduces `__should_decompress_synchronously' to cleanup `z_erofs_vle_normalaccess_readpages'. Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 11 +++ drivers/staging/erofs/super.c | 5 + drivers/staging/erofs/unzip_vle.c | 20 ++--

[PATCH 3/6] staging: erofs: drop multiref support temporarily

2018-09-18 Thread Gao Xiang
Multiref support means that a compressed page could have more than one reference, which is designed for on-disk data deduplication. However, mkfs doesn't support this mode at this moment, and the kernel implementation is also broken. Let's drop multiref support. If it is fully implemented in the

[PATCH 1/6] staging: erofs: remove redundant CONFIG_EROFS_FS_XATTRs

2018-09-18 Thread Gao Xiang
some CONFIG_EROFS_FS_XATTR conditions were added because of the historial Linux kernel compatibility, which are unneeded now. Signed-off-by: Gao Xiang --- Hi all, These are cleanup patches in Chao's erofs-dev test tree for a while. Many of them are trivial. In order for all preview

[PATCH 2/6] staging: erofs: fold in `__update_workgrp_llen'

2018-09-18 Thread Gao Xiang
There is the only one user to use `__update_workgrp_llen'. Fold it in `z_erofs_vle_work_iter_begin' and cleanup related code. Signed-off-by: Gao Xiang --- drivers/staging/erofs/unzip_vle.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git

Re: [PATCH] staging: erofs: Fix a unused variable 'arg' warning

2018-09-18 Thread zhong jiang
On 2018/9/19 11:07, cgxu519 wrote: > On 09/19/2018 10:16 AM, zhong jiang wrote: >> I find the following warning when compiling the kernel. >> >> drivers/staging/erofs/super.c:195:6: warning: unused variable 'arg' >> [-Wunused-variable] >>int arg = 0; >> >> Signed-off-by: zhong jiang >> ---

Re: [PATCH] staging: erofs: Fix a unused variable 'arg' warning

2018-09-18 Thread cgxu519
On 09/19/2018 10:16 AM, zhong jiang wrote: I find the following warning when compiling the kernel. drivers/staging/erofs/super.c:195:6: warning: unused variable 'arg' [-Wunused-variable] int arg = 0; Signed-off-by: zhong jiang --- drivers/staging/erofs/super.c | 2 ++ 1 file changed, 2

[PATCH] staging: erofs: Fix a unused variable 'arg' warning

2018-09-18 Thread zhong jiang
I find the following warning when compiling the kernel. drivers/staging/erofs/super.c:195:6: warning: unused variable 'arg' [-Wunused-variable] int arg = 0; Signed-off-by: zhong jiang --- drivers/staging/erofs/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [PATCH v3 4/4] staging: erofs: option validation in remount

2018-09-18 Thread Gao Xiang via Linux-erofs
Hi Chengguang, On 2018/9/18 23:10, Chengguang Xu wrote: > Add option validation in remount. After this patch, remount > can change recognized options, and for unknown options remount > will fail and report error. > > Signed-off-by: Chengguang Xu > Reviewed-by: Chao Yu > --- >

Re: [PATCH v3 3/4] staging: erofs: code cleanup for erofs_show_options()

2018-09-18 Thread Gao Xiang via Linux-erofs
On 2018/9/18 23:10, Chengguang Xu wrote: > Add new helper erofs_get_fault_rate() to get fault rate instead of > directly getting it from sbi, so we can remove the macro check > surrounding it. > > Signed-off-by: Chengguang Xu > Reviewed-by: Chao Yu Reviewed-by: Gao Xiang Thanks, Gao Xiang

Re: [PATCH v3 2/4] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-18 Thread Gao Xiang via Linux-erofs
Hi Chengguang, On 2018/9/18 23:10, Chengguang Xu wrote: > Define a dummpy function of erofs_build_fault_attr() when macro > CONFIG_EROFS_FAULT_INJECTION is disabled, so that we don't have to > check the macro in calling place. Based on above adjustment, > do proper code cleanup for option parsing

[PATCH v3 1/4] staging: erofs: code cleanup for erofs_kmalloc()

2018-09-18 Thread Chengguang Xu
Define a dummy function of time_to_inject()/erofs_show_injection_info(), so that we don't have to check macro CONFIG_EROFS_FAULT_INJECTION in calling place. Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu Reviewed-by: Gao Xiang --- drivers/staging/erofs/internal.h | 13 ++--- 1 file

[PATCH v3 4/4] staging: erofs: option validation in remount

2018-09-18 Thread Chengguang Xu
Add option validation in remount. After this patch, remount can change recognized options, and for unknown options remount will fail and report error. Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu --- drivers/staging/erofs/super.c | 38 --- 1 file changed,

[PATCH v3 3/4] staging: erofs: code cleanup for erofs_show_options()

2018-09-18 Thread Chengguang Xu
Add new helper erofs_get_fault_rate() to get fault rate instead of directly getting it from sbi, so we can remove the macro check surrounding it. Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu --- drivers/staging/erofs/super.c | 14 +++--- 1 file changed, 11 insertions(+), 3

Re: [PATCH v2 0/8] staging: erofs: error handing and more tracepoints

2018-09-18 Thread Gao Xiang
Hi Greg, On 2018/9/18 22:36, Greg Kroah-Hartman wrote: > On Tue, Sep 18, 2018 at 10:25:32PM +0800, Gao Xiang wrote: >> change log v2: >> - fix a gcc warning reported by Greg for the patch >> staging: erofs: clean up z_erofs_map_blocks_iter >> >> >> In order to avoid conflicts with

Re: [PATCH v2 2/6] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-18 Thread Gao Xiang
Hi Chengguang, On 2018/9/18 18:47, cgxu519 wrote: > On 09/18/2018 03:07 PM, Gao Xiang wrote: >> Hi Chengguang, >> >> On 2018/9/17 23:34, Chengguang Xu wrote: >>> Define a dummpy function of erofs_build_fault_attr() when macro >>> CONFIG_EROFS_FAULT_INJECTION is disabled, so that we don't have to

Re: [PATCH 0/8] staging: erofs: error handing and more tracepoints

2018-09-18 Thread Dan Carpenter
On Tue, Sep 18, 2018 at 08:31:22PM +0800, Gao Xiang wrote: > (I have no clang environment to build kernel yet... :( I will try later, but > I have no idea why it happens, > and it seems a false warning). > > Thanks, > Gao Xiang > > > > > Or is gcc just being "dumb" here? What about clang,

Re: [PATCH 0/8] staging: erofs: error handing and more tracepoints

2018-09-18 Thread Gao Xiang
Hi Greg, On 2018/9/18 20:14, Greg Kroah-Hartman wrote: > On Tue, Sep 18, 2018 at 08:02:30PM +0800, Gao Xiang wrote: >> Hi Greg, >> >> On 2018/9/18 19:19, Greg Kroah-Hartman wrote: >>> On Fri, Sep 14, 2018 at 10:40:22PM +0800, Gao Xiang wrote: In order to avoid conflicts with cleanup patches,

Re: [PATCH 0/8] staging: erofs: error handing and more tracepoints

2018-09-18 Thread Gao Xiang
Hi Greg, On 2018/9/18 19:19, Greg Kroah-Hartman wrote: > On Fri, Sep 14, 2018 at 10:40:22PM +0800, Gao Xiang wrote: >> In order to avoid conflicts with cleanup patches, Chao and I think >> it is better to send reviewed preview patches in the erofs mailing list >> to the community in time. >> >>

Re: [PATCH 0/8] staging: erofs: error handing and more tracepoints

2018-09-18 Thread Greg Kroah-Hartman
On Tue, Sep 18, 2018 at 08:02:30PM +0800, Gao Xiang wrote: > Hi Greg, > > On 2018/9/18 19:19, Greg Kroah-Hartman wrote: > > On Fri, Sep 14, 2018 at 10:40:22PM +0800, Gao Xiang wrote: > >> In order to avoid conflicts with cleanup patches, Chao and I think > >> it is better to send reviewed preview

Re: [PATCH v2 6/6] staging: erofs: option validation in remount

2018-09-18 Thread Chao Yu
On 2018/9/17 23:34, Chengguang Xu wrote: > Add option validation in remount. After this patch, remount > can change recognized options, and for unknown options remount > will fail and report error. > > Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu Thanks,

Re: [PATCH v2 4/6] staging: erofs: introduce a new helper erofs_get_fault_rate()

2018-09-18 Thread Chao Yu
On 2018/9/17 23:34, Chengguang Xu wrote: > Introduce a new helper for getting fault rate, so that we > don't have to check macro in calling place. > > Signed-off-by: Chengguang Xu Can you fold this patch into [5/6]? Thanks,

Re: [PATCH v2 3/6] staging: erofs: introduce a new helper __erofs_build_fault_attr()

2018-09-18 Thread Chao Yu
On 2018/9/17 23:34, Chengguang Xu wrote: > Introduce a new helper __erofs_build_fault_attr() to handle set/clear > erofs_fault_info, we need this funciton for internal use case. > for example, reset fault_injection option in remount. > > Signed-off-by: Chengguang Xu Since this patch is related

Re: [PATCH v2 2/6] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-18 Thread cgxu519
On 09/18/2018 03:07 PM, Gao Xiang wrote: Hi Chengguang, On 2018/9/17 23:34, Chengguang Xu wrote: Define a dummpy function of erofs_build_fault_attr() when macro CONFIG_EROFS_FAULT_INJECTION is disabled, so that we don't have to check the macro in calling place. Based on above adjustment, do

Re: [PATCH v2 2/6] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-18 Thread Chao Yu
On 2018/9/17 23:34, Chengguang Xu wrote: > Define a dummpy function of erofs_build_fault_attr() when macro > CONFIG_EROFS_FAULT_INJECTION is disabled, so that we don't have to > check the macro in calling place. Based on above adjustment, > do proper code cleanup for option parsing of

Re: [PATCH v2 1/6] staging: erofs: code cleanup for erofs_kmalloc()

2018-09-18 Thread Chao Yu
On 2018/9/17 23:34, Chengguang Xu wrote: > Define a dummy function of time_to_inject()/erofs_show_injection_info(), > so that we don't have to check macro CONFIG_EROFS_FAULT_INJECTION in > calling place. > > Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu Thanks,

Re: [PATCH v2 2/6] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-18 Thread Gao Xiang
Hi Chengguang, On 2018/9/17 23:34, Chengguang Xu wrote: > Define a dummpy function of erofs_build_fault_attr() when macro > CONFIG_EROFS_FAULT_INJECTION is disabled, so that we don't have to > check the macro in calling place. Based on above adjustment, > do proper code cleanup for option parsing