[PATCH] staging: erofs: set sb->s_root to NULL when failing from __getname()

2019-05-06 Thread Chengguang Xu
Set sb->s_root to NULL when failing from __getname(), so that we can avoid double dput and unnecessary operations in generic_shutdown_super(). Signed-off-by: Chengguang Xu --- drivers/staging/erofs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/erofs/super.

[PATCH 1/2] staging: erofs: remove redundant likely/unlikely annotation in namei.c

2019-02-11 Thread Chengguang Xu
unlikely has already included in IS_ERR(), so just remove redundant likely/unlikely annotation. Signed-off-by: Chengguang Xu --- drivers/staging/erofs/namei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c

[PATCH 2/2] staging: erofs: remove redundant unlikely annotation in unzip_vle.c

2019-02-11 Thread Chengguang Xu
unlikely has already included in IS_ERR(), so just remove it. Signed-off-by: Chengguang Xu --- drivers/staging/erofs/unzip_vle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c index 4ac1099a39c6

[PATCH] staging: erofs: fix potential double iput in erofs_read_super()

2019-01-22 Thread Chengguang Xu
Some error cases like failing from d_make_root() will cause double iput because d_make_root() also does iput in its error path. Signed-off-by: Chengguang Xu --- Only compile tested. drivers/staging/erofs/super.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a

[PATCH] staging: erofs: change inode related info in erofs_statfs()

2018-09-24 Thread Chengguang Xu
As a read only filesystem, it's better to show available inode num as 0 in statfs. Signed-off-by: Chengguang Xu --- drivers/staging/erofs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c

[PATCH v4 3/3] staging: erofs: option validation in remount

2018-09-19 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 Reviewed-by: Gao Xiang --- drivers/staging/erofs/super.c | 37

[PATCH v4 2/3] staging: erofs: code cleanup for erofs_show_options()

2018-09-19 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 Reviewed-by: Gao Xiang --- drivers/staging/erofs/super.c | 14 +++--- 1 file changed, 11

[PATCH v4 1/3] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-19 Thread Chengguang Xu
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 fault_injection. Signed-off-by: Chengguang Xu Review

[PATCH v4 0/3] staging: erofs: option validation for remount and some code cleanups

2018-09-19 Thread Chengguang Xu
e on latest erofs branch in Chao's linux tree. - Fix building issue. Chengguang Xu (3): staging: erofs: code cleanup for option parsing of fault_injection staging: erofs: code cleanup for erofs_show_options() staging: erofs: option validation in remount drive

[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

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

2018-09-18 Thread Chengguang Xu
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 fault_injection. Signed-off-by: Chengguang Xu Review

[PATCH v3 0/4] staging: erofs: option validation for remount and some code cleanups

2018-09-18 Thread Chengguang Xu
on latest erofs branch in Chao's linux tree. - Fix building issue. Hi Greg, You may pick up rest 2-4 patches in this patch set if there are no more comments from Chao and Xiang. Thanks, Chengguang Xu (4): staging: erofs: code cleanup for erofs_kmalloc() staging: erofs: code cleanup

[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 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

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

2018-09-17 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 --- drivers/staging/erofs/super.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers

[PATCH v2 5/6] staging: erofs: code cleanup for erofs_show_options()

2018-09-17 Thread Chengguang Xu
Call 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 --- drivers/staging/erofs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/erofs

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

2018-09-17 Thread Chengguang Xu
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 --- drivers/staging/erofs/super.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/su

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

2018-09-17 Thread Chengguang Xu
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 --- drivers/staging/erofs/super.c | 25 +++-- 1 file

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

2018-09-17 Thread Chengguang Xu
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 fault_injection. Signed-off-by: Chengguang Xu --- dr

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

2018-09-17 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 --- drivers/staging/erofs/internal.h | 13 ++--- 1 file changed, 10 insertions(+), 3 dele

[PATCH v2 0/6] staging: erofs: option validation for remount and some code cleanups

2018-09-17 Thread Chengguang Xu
o the code looks clean and more understandable. v1->v2: Address Chao's comments: - Allow to set fault_injection=0. - Keep flag bit when setting fault_injection=0. - Show injection info in original place. - Rebase code on latest erofs branch in Chao's linux tree. - Fix building issue.

[PATCH 3/7] staging: erofs: introduce a new helper __erofs_build_fault_attr()

2018-09-11 Thread Chengguang Xu
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 --- drivers/staging/erofs/super.c | 26 ++ 1 file

[PATCH 6/7] staging: erofs: code cleanup for erofs_show_options()

2018-09-11 Thread Chengguang Xu
Call 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 --- drivers/staging/erofs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/erofs

[PATCH 5/7] staging: erofs: introduce a new helper erofs_get_fault_rate()

2018-09-11 Thread Chengguang Xu
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 --- drivers/staging/erofs/super.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/su

[PATCH 7/7] staging: erofs: option validation in remount

2018-09-11 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 --- drivers/staging/erofs/super.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers

[PATCH 2/7] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-11 Thread Chengguang Xu
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 fault_injection. Signed-off-by: Chengguang Xu --- dr

[PATCH 4/7] staging: erofs: return -EINVAL when specifying fault rate to 0

2018-09-11 Thread Chengguang Xu
Set fault rate to 0 is useless and confusable, so add check to avoid it. Signed-off-by: Chengguang Xu --- drivers/staging/erofs/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index d2dbc1fd3abb..8df680aee55a 100644

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

2018-09-11 Thread Chengguang Xu
Define a dummy function of time_to_inject(), so that we don't have to check macro CONFIG_EROFS_FAULT_INJECTION in calling place. Base on above adjustment, do proper code cleanup for erofs_kmalloc(). Signed-off-by: Chengguang Xu --- drivers/staging/erofs/internal.h | 16 ++-- 1

[PATCH 0/7] staging: erofs: option validation for remount and some code cleanups

2018-09-11 Thread Chengguang Xu
o the code looks clean and more understandable. Chengguang Xu (7): staging: erofs: code cleanup for erofs_kmalloc() staging: erofs: code cleanup for option parsing of fault_injection staging: erofs: introduce a new helper __erofs_build_fault_attr() staging: erofs: return -EINVAL when speci

[PATCH] erofs: option validation in remount

2018-09-11 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 --- drivers/staging/erofs/super.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers

[PATCH v2] erofs: surround fault_injection ralted option parsing using CONFIG_EROFS_FAULT_INJECTION

2018-09-10 Thread Chengguang Xu
ption POSIX_ACL and FS_XATTR. Signed-off-by: Chengguang Xu --- v1->v2: - modify warning message. drivers/staging/erofs/super.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 1aec509c805f..4ad55dcb8e6

[PATCH] erofs: surround fault_injection ralted option parsing using CONFIG_EROFS_FAULT_INJECTION

2018-09-10 Thread Chengguang Xu
ption POSIX_ACL and FS_XATTR. Signed-off-by: Chengguang Xu --- drivers/staging/erofs/super.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 1aec509c805f..4004a00d150d 100644 --- a/drivers/staging/erofs/su