[PATCH v5] erofs: introduce error injection infrastructure

2018-06-30 Thread Gao Xiang via Linux-erofs
From: Chao Yu This patch introduces error injection infrastructure, with it, we can inject error in any kernel exported common functions which erofs used, so that it can force erofs running into error paths, it turns out that tests can cover real rare paths more easily to find bugs.

Re: [PATCH v5] erofs: introduce error injection infrastructure

2018-06-30 Thread Gao Xiang via Linux-erofs
On 2018/7/1 11:56, Chao Yu wrote: Thanks for fixing these issues. Thanks, ;) Thanks, Gao Xiang

Re: [WIP] [NOMERGE] [RFC PATCH v0.3 3/6] erofs: introduce erofs_map_blocks_iter

2018-06-30 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/7/1 12:17, Gao Xiang wrote: , I permanently dropped the last patch of EROFS v1 locally  [RFC PATCH RESEND 12/12] erofs: introduce VLE decompression support (experimental) Sorry for the confusion :'( I left some words on the last patch of this patchset, [WIP] [NOMERGE]

Re: [WIP] [NOMERGE] [RFC PATCH v0.3 3/6] erofs: introduce erofs_map_blocks_iter

2018-06-30 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/7/1 11:56, Chao Yu wrote: Hi Xiang, It fails 'git-am' or 'git apply --reject' when applying patches beginning from this one in the patch set to erofs branch, could you rebase the code? Thanks, this patchset is now based on [RFC PATCH RESEND 11/12] erofs: introduce a

[RFC PATCH] staging: erofs: harden inode lookup for 32-bit platform

2018-07-29 Thread Gao Xiang via Linux-erofs
This patch introduces inode hash function, test and set callbacks, and iget5_locked to find the right inode for 32-bit platform. Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c| 37 +++- drivers/staging/erofs/internal.h | 10 + 2 files changed,

Re: [PATCH] staging: erofs: fix if assignment style issue

2018-08-05 Thread Gao Xiang via Linux-erofs
Hi Kristaps, On 2018/8/5 23:21, Kristaps Čivkulis wrote: > Fix coding style issue "do not use assignment in if condition" > detected by checkpatch.pl. > > Signed-off-by: Kristaps Čivkulis I don't know whether this rule is mandatory or not for the current linux kernel when I checked the original

Re: [PATCH v2] staging: erofs: disable compiling temporarile

2018-08-02 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/8/2 17:39, Chao Yu wrote: > As Stephen Rothwell reported: > > "After merging the staging tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > drivers/staging/erofs/super.c: In function 'erofs_read_super': > drivers/staging/erofs/super.c:343:17: error:

Re: [WIP] [PATCH] staging: erofs: cleanup z_erofs_do_read_page

2018-08-10 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/8/10 16:59, Chao Yu wrote: > Hi Xiang, > > On 2018/8/10 14:59, Gao Xiang wrote: >> Hi Chao, >> >> On 2018/8/10 14:53, Chao Yu wrote: >>> On 2018/8/9 18:09, Gao Xiang wrote: This patch adds error handing code, and fixes a bug when appling caching policy, which can cause

Re: [RFC PATCH RESEND] staging: erofs: harden inode lookup for 32-bit platforms

2018-08-10 Thread Gao Xiang via Linux-erofs
ping... On 2018/7/30 3:26, Gao Xiang wrote: > This patch introduces inode hash function, test and set callbacks, > and iget5_locked to find the right inode for 32-bit platforms. > > Signed-off-by: Gao Xiang > --- > > fix the commit message > > drivers/staging/erofs/inode.c| 37

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

[PREVIEW] [PATCH v4 2/3] staging: erofs: separate erofs_get_meta_page

2018-08-12 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 v4 06/10] staging: erofs: fix compression mapping beyond EOF

2018-08-12 Thread Gao Xiang via Linux-erofs
From: Gao Xiang Logical address of EOF LTP mapping should start at `inode->i_size' rather than `inode->i_size - 1' to `m_la(in)', fix it. Reviewed-by: Chao Yu Signed-off-by: Chao Yu Signed-off-by: Gao Xiang --- change log v4: - fix the description `m_la(in) + 1 - inode->i_size' to

[PREVIEW] [PATCH v4 05/10] staging: erofs: fix integer overflow on 32-bit platform

2018-08-12 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch fixes integer overflow on multiplication of 32-bit `lcn' in z_erofs_map_blocks_iter. Reviewed-by: Chao Yu Signed-off-by: Chao Yu Signed-off-by: Gao Xiang --- change log v4: - fix commit message a bit. change log v3: - spilt into small patches at Chao's

Re: [PREVIEW] [PATCH v3 2/3] staging: erofs: separate erofs_get_meta_page

2018-08-12 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/8/12 18:54, Chao Yu wrote: > On 2018/8/11 0:48, Gao Xiang wrote: >> 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 >>

Re: [PATCH] staging: erofs: fix error handling in __erofs_get_meta_page

2018-08-20 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/8/20 22:59, Chao Yu wrote: > On 2018/8/20 21:29, Gao Xiang wrote: >> As Dan reported in LKP's mailing list: >> >> https://lists.01.org/pipermail/kbuild-all/2018-August/051419.html >> >> New smatch warnings: >> drivers/staging/erofs/internal.h:446 erofs_grab_bio() warn: should

Re: [PATCH] Revert "staging: erofs: disable compiling temporarile"

2018-08-28 Thread Gao Xiang via Linux-erofs
On 2018/8/29 7:44, Stephen Rothwell wrote: > Unfortunately, those vfs changes are still in the vfs tree in > linux-next and cause a build failure in the erofs code. I have > disabled the build of erofs again for today. feel a bit loss after hear that... :'( > > Dave, Al, it would be good if

[PATCH RESEND] staging: erofs: clean erofs_lookup()

2018-10-12 Thread Gao Xiang via Linux-erofs
From: Al Viro d_splice_alias() does the right thing when given ERR_PTR(-E...) for inode. No need for gotos, multiple returns, etc. in there. Signed-off-by: Al Viro Reviewed-by: Gao Xiang Signed-off-by: Gao Xiang --- Hi, Frankly, I think it is a straight-forward cleanup by Al enough

Re: [PATCH RESEND] staging: erofs: clean erofs_lookup()

2018-10-13 Thread Gao Xiang via Linux-erofs
Hi, Please ignore this patch, it has been queued by Al for 4.20 in https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next=8300807f9e2dffb6552514763ad60e005c12eb94 Sorry for bothering... Thanks, Gao Xiang On 2018/10/13 1:59, Gao Xiang via Linux-erofs wrote: > From:

[PREVIEW] [RFC PATCH chao/erofs-dev v2] staging: erofs: decompress asynchronously if PG_readahead page at first

2018-10-28 Thread Gao Xiang via Linux-erofs
From: Gao Xiang For the case of nr_to_read == lookahead_size, it is better to decompress asynchronously as well since no page will be needed immediately. Signed-off-by: Gao Xiang --- change log v2: - fix the condition that it could missing flags if some pages fail to add_to_page_cache_lru

[PREVIEW] [RFC PATCH chao/erofs-dev v2 RESEND] staging: erofs: decompress asynchronously if PG_readahead page at first

2018-10-28 Thread Gao Xiang via Linux-erofs
From: Gao Xiang For the case of nr_to_read == lookahead_size, it is better to decompress asynchronously as well since no page will be needed immediately. Signed-off-by: Gao Xiang --- change log v2: - fix the condition that it could missing flags if some pages fail to add_to_page_cache_lru

Re: [PATCH chao/erofs-dev 1/2] staging: erofs: separate into init_once / always

2018-11-04 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/11/4 23:35, Chao Yu wrote: > Yes, it needs rebase below two patches to last erofs-dev branch. > > staging: erofs: separate into init_once / always > staging: erofs: locked before registering for all new workgroups > > Thanks, I think the erofs-dev branch is missing a

Re: [Outreachy kernel] Re: [PATCH v3 2/2] staging: erofs: Modify conditional checks

2018-11-05 Thread Gao Xiang via Linux-erofs
Hi Bhagyashri, On 2018/11/6 2:07, Bhagyashri Dighole wrote: > Hi Gao, > > In PATCH version v1 which is first stage of contribution, I modified data.c > for all alignment changes and all conditional checks. As per discussion on > email for this patch, It was concluded that I need to re-submit

[PATCH] staging: erofs: fix undefined LZ4_decompress_safe_partial()

2018-11-09 Thread Gao Xiang via Linux-erofs
It needs an explicit LZ4 library dependency if lz4 compression is enabled, found by kbuild randconfig. Reported-by: kbuild test robot Fixes: 05f9d4a0c8c4 ("staging: erofs: use the new LZ4_decompress_safe_partial()") Signed-off-by: Gao Xiang --- drivers/staging/erofs/Kconfig | 3 ++- 1 file

Re: [PREVIEW] [PATCH chao/erofs-dev 1/3] staging: erofs: harden inode lookup for 32-bit platforms

2018-09-30 Thread Gao Xiang via Linux-erofs
Hi Chao On 2018/10/1 11:04, Chao Yu wrote: >> /* inode.c */ >> +static inline unsigned long erofs_inode_hash(erofs_nid_t nid) >> +{ >> +u64 h = nid; > unsigned long h; > >> + >> +#if BITS_PER_LONG == 32 >> +h = (h >> 32) ^ (h & 0x); > h = (nid >> 32) ^ (nid & 0x); > >>

Re: [PREVIEW] [PATCH chao/erofs-dev 1/3] staging: erofs: harden inode lookup for 32-bit platforms

2018-09-30 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/10/1 9:57, Chao Yu wrote: > On 2018-9-21 11:43, Gao Xiang wrote: >> This patch introduces inode hash function, test and set callbacks, >> and iget5_locked to find the right inode for 32-bit platforms. >> >> Signed-off-by: Gao Xiang >> --- >> drivers/staging/erofs/inode.c|

[PREVIEW][PATCH v2 chao/erofs-dev] staging: erofs: harden inode lookup for 32-bit platforms

2018-09-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch introduces inode hash function, test and set callbacks, and iget5_locked to find the right inode for 32-bit platforms. Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c| 37 - drivers/staging/erofs/internal.h | 9

Re: [PATCH] clean erofs_lookup()

2018-10-10 Thread Gao Xiang via Linux-erofs
Hi Alexander, On 2018/10/11 3:01, Al Viro wrote: > d_splice_alias() does the right thing when given > ERR_PTR(-E...) for inode. No need for gotos, multiple > returns, etc. in there. That is correct :) Thanks for your patch and attention. Once in the first version we used "d_add" rather

Re: [PREVIEW] [PATCH chao/erofs-dev 2/3] staging: erofs: fix race when the managed cache is enabled

2018-10-01 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/10/1 17:49, Chao Yu wrote: > On 2018-9-21 11:43, Gao Xiang wrote: >> When the managed cache is enabled, the last reference count >> of a workgroup must be used for its workstation. >> >> Otherwise, it could lead to incorrect (un)freezes in >> the reclaim path, and it would be

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

2018-09-19 Thread Gao Xiang via Linux-erofs
Hi Chengguang, On 2018/9/19 22:53, Chengguang Xu wrote: > Hi Greg, Xiang > > I rebased code on latest erofs-master branch and that branch > has already merged the first patch in my previous patchset, > so this time I only post rest 3 patches. Great, at the most time Chao's erofs-master is the

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

2018-09-19 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/9/19 23:32, Gao Xiang via Linux-erofs wrote: > Hi Chao, > > On 2018/9/19 23:26, Chao Yu wrote: >> Hi Xiang, >> >> On 2018/9/19 13:49, Gao Xiang wrote: >>> This patch introduces `__should_decompress_synchronously' to >>>

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

2018-09-19 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2018/9/19 23:45, Chao Yu wrote: > Hi Xiang, > > On 2018/9/19 23:32, Gao Xiang wrote: >> Hi Chao, >> >> On 2018/9/19 23:26, Chao Yu wrote: >>> Hi Xiang, >>> >>> On 2018/9/19 13:49, Gao Xiang wrote: This patch introduces `__should_decompress_synchronously' to cleanup

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

2018-09-19 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch introduces `__should_decompress_synchronously' to cleanup `z_erofs_vle_normalaccess_readpages'. Signed-off-by: Gao Xiang --- change log v2: - Leave the original threshold "3" for DEFAULT_MAX_SYNC_DECOMPRESS_PAGES and just do the cleanup work.

Re: [PREVIEW] [RFC PATCH 1/5] erofs-mkfs: add erofs on-disk layout

2018-11-17 Thread Gao Xiang via Linux-erofs
On 2018/11/16 11:30, bluce.ligu...@huawei.com wrote: > From: Li Guifu > > This patch adds a header file describing the erofs on-disk layout, which > should be kept in line with the kernel implementation all the time. > > Signed-off-by: Li Guifu > Signed-off-by: Miao Xie > Signed-off-by:

Re: [PATCH 4/5] drivers: staging: erofs: Fix parentheses error in macro

2018-12-11 Thread Gao Xiang via Linux-erofs
Hi Joe, On 2018/12/11 23:48, Joe Perches wrote: > This macro is used only once and is merely obfuscation > for that one use. Please remove the macro and expand > it in the one place it is used. I am also considering to replace it in a plain way, it will be more straight-forward to describe its

[PATCH] erofs-mkfs: mkfs_erofs.h: clean up definitions

2018-12-11 Thread Gao Xiang via Linux-erofs
remove some duplicated definitions and keep in line with kernel names. Signed-off-by: Gao Xiang --- erofs_cache.c | 11 --- erofs_io.c| 3 +-- mkfs_erofs.h | 23 ++- mkfs_file.c | 4 ++-- mkfs_inode.c | 28 ++-- mkfs_main.c | 6

[PATCH] staging: erofs: remove __EROFS_BIT

2018-12-11 Thread Gao Xiang via Linux-erofs
It's better to use pre-calculated values to make on-disk definition more straight-forward and human-readable. Since there is the only one user, let's remove __EROFS_BIT entirely. Suggested-by: Joe Perches Signed-off-by: Gao Xiang --- drivers/staging/erofs/erofs_fs.h | 8 +++- 1 file

Re: [PATCH] erofs-utils: fix the source code hierarchy

2018-12-24 Thread Gao Xiang via Linux-erofs
On 2018/12/23 21:02, Li Guifu wrote: > 1. move generic header files, erofs_fs.h and list_head.h, into include/ > 2. move the other mkfs source files into mkfs/ > > Signed-off-by: Li Guifu Applied with updating the commit message. Thanks, Gao Xiang

Re: [PATCH] erofs-utils: fix tab algin to 8 spaces in the Makefile.am

2018-12-24 Thread Gao Xiang via Linux-erofs
Hi Guifu, On 2018/12/24 18:28, Li Guifu wrote: > The tab isnot 8 spaces in the Makefile.am, one line has > been exceed 80 spaces, fix them. > > Signed-off-by: Li Guifu > --- > mkfs/Makefile.am | 37 +++-- > 1 file changed, 19 insertions(+), 18 deletions(-) > >

[PATCH v2 03/10] staging: erofs: fix race when the managed cache is enabled

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang When the managed cache is enabled, the last reference count of a workgroup must be used for its workstation. Otherwise, it could lead to incorrect (un)freezes in the reclaim path, and it would be harmful. A typical race as follows: Thread 1 (In the reclaim path) Thread 2

[PATCH v2 04/10] staging: erofs: atomic_cond_read_relaxed on ref-locked workgroup

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang It's better to use atomic_cond_read_relaxed, which is implemented in hardware instructions to monitor a variable changes currently for ARM64, instead of open-coded busy waiting. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 30

[PATCH v2 02/10] staging: erofs: fix the definition of DBG_BUGON

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang It's better not to positively BUG_ON the kernel, however developers need a way to locate issues as soon as possible. DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG (EROFS developping feature) is on. It is helpful for developers to find and solve bugs quickly

[PATCH v2 01/10] staging: erofs: fix `trace_erofs_readpage' position

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang `trace_erofs_readpage' was designed for .readpage() interface hook in order to trace the detailed synchronized read rather than the internal implementation `z_erofs_do_read_page' which both .readpage() and .readpages() use. It seems the tracepoint was placed to a wrong place by

[PATCH v2 00/10] staging: erofs: decompression stability enhancement

2018-11-22 Thread Gao Xiang via Linux-erofs
Hi, This patchset mainly focuses on erofs decompression stability, most of them are found in the internal beta test. Some patches which are still in testing or reviewing aren't included in this patchset and will be sent after carefully testing. Thanks, Gao Xiang Changelog from v1 === o fix a

[PATCH v2 05/10] staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}'

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang There are two minor issues in the current freeze interface: 1) Freeze interfaces have not related with CONFIG_DEBUG_SPINLOCK, therefore fix the incorrect conditions; 2) For SMP platforms, it should also disable preemption before doing atomic_cmpxchg in case

[PATCH v2 09/10] staging: erofs: decompress asynchronously if PG_readahead page at first

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang For the case of nr_to_read == lookahead_size, it is better to decompress asynchronously as well since no page will be needed immediately. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/unzip_vle.c | 9 - 1 file changed, 8 insertions(+), 1

[PATCH v2 07/10] staging: erofs: separate into init_once / always

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang `z_erofs_vle_workgroup' is heavily generated in the decompression, for example, it resets 32 bytes redundantly for 64-bit platforms even through Z_EROFS_VLE_INLINE_PAGEVECS + Z_EROFS_CLUSTER_MAX_PAGES, default 4, pages are stored in `z_erofs_vle_workgroup'. As an another

[PATCH v2 08/10] staging: erofs: locked before registering for all new workgroups

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang Let's make sure that the one registering a workgroup will also take the primary work lock at first for two reasons: 1) There's no need to introduce such a race window (and consequently overhead) between registering and locking, other tasks could break in by chance,

[PATCH v2 10/10] staging: erofs: rename strange variable names in z_erofs_vle_frontend

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang Previously, 2 members called `initial' and `cachedzone_la' are used for applying caching policy (whether the workgroup is at either end), which are hard to understand, rename them to `backmost' and `headoffset'. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang ---

[PATCH v2 06/10] staging: erofs: add a full barrier in erofs_workgroup_unfreeze

2018-11-22 Thread Gao Xiang via Linux-erofs
From: Gao Xiang Just like other generic locks, insert a full barrier in case of memory reorder. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/erofs/internal.h

Re: [PATCH v2] staging: erofs: clean up erofs_map_blocks_iter

2019-01-09 Thread Gao Xiang via Linux-erofs
Hi Chao, On 2019/1/10 9:34, Chao Yu wrote: > This patch cleans up erofs_map_blocks* function and structure family, > just simply the code, no logic change. > > Signed-off-by: Chao Yu > --- > v2: > - fix to handle map->mpage correctly in erofs_map_blocks > - fix to add definition if

Re: [PATCH v2] staging: erofs: Add identifier for function definition arguments

2019-01-08 Thread Gao Xiang via Linux-erofs
On 2019/1/8 21:24, Sidong Yang wrote: > Add identifier for function definition arguments in xattr_iter_handlers, > this change clears the checkpatch.pl issue and make code more explicit. > > Signed-off-by: Sidong Yang personally looks good to me. Reviewed-by: Gao Xiang Thanks, Gao Xiang

[PATCH 2/2] erofs-utils: move 'ACLOCAL_AMFLAGS = -I m4' to $(top_srcdir)/Makefile.am

2019-01-11 Thread Gao Xiang via Linux-erofs
Signed-off-by: Gao Xiang --- Makefile.am | 2 ++ mkfs/Makefile.am | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index cb574c3..0eb37d6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ # Makefile.am +ACLOCAL_AMFLAGS = -I m4 +

[PATCH 1/2] erofs-utils: remove redundant EROFS_MKFS_VERSION

2019-01-11 Thread Gao Xiang via Linux-erofs
Let's use PACKAGE_VERSION exported by autoconf instead. Reset the version to 0.5 since there are still some stuffs to do. Signed-off-by: Gao Xiang --- configure.ac| 2 +- mkfs/Makefile.am| 2 +- mkfs/erofs_config.c | 3 ++- mkfs/erofs_config.h | 4 ++-- 4 files changed, 6

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

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 3/7] staging: erofs: introduce a new helper __erofs_build_fault_attr()

2018-09-12 Thread Gao Xiang via Linux-erofs
On 2018/9/12 22:23, cgxu519 wrote: > On 09/12/2018 07:22 PM, Gao Xiang wrote: >> Hi Chengguang, >> >> On 2018/9/12 13:10, 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

Re: [PATCH v4] staging: erofs: use explicit unsigned int type

2018-09-13 Thread Gao Xiang via Linux-erofs
Hi Thomas, ping... On 2018/9/12 14:21, Gao Xiang wrote: > Hi Thomas, > > On 2018/9/11 3:41, Thomas Weißschuh wrote: >> Hi Chao, >> >> On Mon, 2018-09-10T23:59+0800, Chao Yu wrote: >>> [...] > I was not aware of this tree and worked off of staging / next. > A patch is attached to this

[PATCH v3 2/2] staging: erofs: complete POSIX ACL support

2019-01-25 Thread Gao Xiang via Linux-erofs
From: Gao Xiang Let's add .get_acl() to read the file's acl from its xattrs to make POSIX ACL usable. Here is the on-disk detail, fullname: system.posix_acl_access struct erofs_xattr_entry: .e_name_len = 0 .e_name_index = EROFS_XATTR_INDEX_POSIX_ACL_ACCESS (2) fullname:

[PATCH v3 1/2] staging: erofs: use xattr_prefix to wrap up

2019-01-25 Thread Gao Xiang via Linux-erofs
From: Gao Xiang Let's use xattr_prefix instead of open code. No logic changes. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c

Re: [PATCH v2 2/2] staging: erofs: complete POSIX ACL support

2019-01-28 Thread Gao Xiang via Linux-erofs
On 2019/1/28 22:28, Dan Carpenter wrote: > The point is, that people shouldn't recreate core code that already > exists. At least try it out and have an explanation why the other code > doesn't work. > > In other projects, the default is to keep code around once it has been > written but in

[PATCH] staging: erofs: keep corrupted fs from crashing kernel in erofs_readdir()

2019-03-28 Thread Gao Xiang via Linux-erofs
From: Gao Xiang After commit 419d6efc50e9, kernel cannot be crashed in the namei path. However, corrupted nameoff can do harm in the process of readdir for scenerios without dm-verity as well. Fix it now. Fixes: 3aa8ec716e52 ("staging: erofs: add directory operations") Cc: # 4.19+

[PATCH for-4.19 1/2] xarray: Replace exceptional entries

2019-02-25 Thread Gao Xiang via Linux-erofs
From: Matthew Wilcox commit 3159f943aafdbacb2f94c38fdaadabf2bbde2a14 upstream. Introduce xarray value entries and tagged pointers to replace radix tree exceptional entries. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value

[PATCH for-4.19 2/2] staging: erofs: fix race when the managed cache is enabled

2019-02-25 Thread Gao Xiang via Linux-erofs
From: Gao Xiang commit 51232df5e4b268936beccde5248f312a316800be upstream. When the managed cache is enabled, the last reference count of a workgroup must be used for its workstation. Otherwise, it could lead to incorrect (un)freezes in the reclaim path, and it would be harmful. A typical race

Re: [patch 1/1]erofs-utils:0001-Improve-README.patch

2019-03-02 Thread Gao Xiang via Linux-erofs
Original patch seems broken. I apply it by hand with some minor changes... >From b6d8c8c6fa91a8ffa7c138578d6315b768372476 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Sun, 3 Mar 2019 14:46:44 +0800 Subject: [PATCH] erofs-utils: improve README This patch improves the build section and

Re: [patch 1/1]erofs-utils:0001-Improve-README.patch

2019-03-03 Thread Gao Xiang via Linux-erofs
Hi Arshad, On 2019/3/3 20:39, Arshad Hussain wrote: > Hi Gao Xiang, > > I prepared the patch using format-patch. Wonder why that should be broken. > Thanks anyway for accepting and applying!. I have no idea as well, I tried in different way (eg, with 3-way merging...) but with no luck :( >

Re: [PATCH] staging: erofs: dir.c fix "alignment should match open parenthesis" issues

2019-03-03 Thread Gao Xiang via Linux-erofs
On 2019/3/4 6:37, Dominik Adamski wrote: > Fix checkpatch issues: "CHECK: Alignment should match open parenthesis" > > Signed-off-by: Dominik Adamski > --- > drivers/staging/erofs/dir.c | 8 duplicated commit...

Re: [PATCH] staging: erofs: inode.c fix checkpatch issues

2019-03-09 Thread Gao Xiang via Linux-erofs
Hi Julian, On 2019/3/10 10:46, Julian Merida wrote: > This patch solves various checkpatch check issues > > Correct indentation on some functions, fix multiple assignments > on a single line and brace-placement on a non-single condition statement. > > Signed-off-by: Julian Merida One patch for

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

2019-02-13 Thread Gao Xiang via Linux-erofs
Hi Chengguang, On 2019/2/13 22:50, cgxu519 wrote: > > On 2/13/19 2:36 PM, Chao Yu wrote: >> On 2019/2/12 11:24, Chengguang Xu wrote: >>> unlikely has already included in IS_ERR(), >>> so just remove it. >>> >>> Signed-off-by: Chengguang Xu >> It looks like we don't need to send two patch to fix

Re: [PATCH v2] staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()

2019-02-11 Thread Gao Xiang via Linux-erofs
kindly ping... some ideas about this patch v2? Thanks, On 2019/2/1 20:16, Gao Xiang wrote: > As Al pointed out, " > ... and while we are at it, what happens to > unsigned int nameoff = le16_to_cpu(de[mid].nameoff); > unsigned int matched = min(startprfx, endprfx); > > struct

Re: patch "staging: erofs: keep corrupted fs from crashing kernel in" added to staging-linus

2019-01-30 Thread Gao Xiang via Linux-erofs
Hi Dan and Greg, On 2019/1/31 4:00, Dan Carpenter wrote: > On Wed, Jan 30, 2019 at 11:42:41PM +0800, Gao Xiang wrote: >> >> On 2019/1/30 23:05, Gao Xiang wrote: >>> Hi Greg, >>> >>> Dan raised some suggestions to me. And I want to get some review ideas from >>> Chao... >>> Current EROFS works

Re: Some new bio merging behaviors in __bio_try_merge_page

2019-04-11 Thread Gao Xiang via Linux-erofs
On 2019/4/11 23:34, Christoph Hellwig wrote: > On Thu, Apr 11, 2019 at 04:09:54PM +0800, Ming Lei wrote: >> I don't think it is a good behaviour to use bio->bi_max_vecs to limit >> max allowed page, you may see the idea from the naming simply... >> >> If there were other such drivers, we may

Re: [PATCH] staging: erofs: fix unexpected out-of-bound data access

2019-04-12 Thread Gao Xiang via Linux-erofs
Hi Christoph, On 2019/4/12 23:06, Christoph Hellwig wrote: >> +++ b/drivers/staging/erofs/data.c >> @@ -304,7 +304,7 @@ static inline struct bio *erofs_read_raw_page(struct bio >> *bio, >> *last_block = current_block; >> >> /* shift in advance in case of it followed by too many gaps

[PATCH 04/13] erofs-utils: add input/output functions

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Li Guifu This patch adds definitions and functions which are mainly used for reading and writing target image files. Signed-off-by: Li Guifu Signed-off-by: Miao Xie Signed-off-by: Fang Wei Signed-off-by: Gao Xiang --- include/erofs/io.h | 33 lib/Makefile.am| 2 +-

[PATCH 12/13] erofs-utils: add a README

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch adds a README and some warnings here. Signed-off-by: Gao Xiang --- README | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 000..4d509be --- /dev/null +++ b/README @@ -0,0 +1,11

[PATCH 00/13] erofs_utils: new mkfs framework

2019-05-30 Thread Gao Xiang via Linux-erofs
Hi all, I spent nearly a month to make big changes to erofs-mkfs, which mainly introduces a new mkfs framework. I personally think it is much cleaner and more scalable than the old one, which is hack and not clean enough. In-place compression is still work-in-progress, thus it isn't included in

[PATCH 09/13] erofs-utils: introduce lz4/lz4hc compression algorithm

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch adds lz4/lz4hc compression algorithms to erofs-utils compression framework in order to enable the fixed-output size compression. Signed-off-by: Gao Xiang --- configure.ac | 65 ++ lib/Makefile.am| 7 +

[PATCH 06/13] erofs-utils: introduce inode operations

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch adds core inode and dentry operations to build the target image. Signed-off-by: Li Guifu [ Gao Xiang: with heavy changes. ] Signed-off-by: Gao Xiang --- include/erofs/inode.h| 21 ++ include/erofs/internal.h | 10 +- lib/Makefile.am | 2 +-

[PATCH 08/13] erofs-utils: introduce generic compression framework

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch adds a new flexable compression framework to user-space utilities, which is designed in order to integrate more compression algorithms easily. Signed-off-by: Gao Xiang --- lib/Makefile.am | 2 +- lib/compressor.c | 74

[PATCH 07/13] erofs-utils: introduce mkfs support

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Li Guifu This patch adds mkfs support to erofs-utils, and it's able to build uncompressed images at the moment. Signed-off-by: Li Guifu Signed-off-by: Gao Xiang --- Makefile.am | 2 +- configure.ac | 3 +- mkfs/Makefile.am | 9 +++ mkfs/main.c | 179

[PATCH 03/13] erofs-utils: introduce miscellaneous files

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Li Guifu This patch introduces a global configuration scheme, some functions which can print messages in different level, build scripts and .gitignore file. Signed-off-by: Li Guifu Signed-off-by: Miao Xie Signed-off-by: Fang Wei Signed-off-by: Gao Xiang --- .gitignore |

[PATCH 01/13] erofs-utils: add erofs on-disk layout

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Li Guifu This patch adds a header file describing the erofs on-disk layout, which should be kept in line with the kernel implementation all the time. Signed-off-by: Li Guifu Signed-off-by: Miao Xie Signed-off-by: Fang Wei Signed-off-by: Gao Xiang --- include/erofs_fs.h | 275

[PATCH 02/13] erofs-utils: introduce erofs-utils basic headers

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Li Guifu This patch adds basic definitions, and a simple kernel-like list implementaion. Signed-off-by: Li Guifu Signed-off-by: Miao Xie Signed-off-by: Fang Wei Signed-off-by: Gao Xiang --- include/erofs/defs.h | 159 +++ include/erofs/err.h

[PATCH 05/13] erofs-utils: introduce buffer cache

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang This patch adds a buffer cache mainly to manage incomplete metadata blocks. mkfs logic is also simplified with the help of buffer cache. Signed-off-by: Miao Xie [ Gao Xiang: with heavy changes. ] Signed-off-by: Gao Xiang --- include/erofs/cache.h | 104 +

[PATCH 13/13] erofs-utils: fix potential erofs_bh_balloon failure

2019-05-30 Thread Gao Xiang via Linux-erofs
From: Gao Xiang erofs_write_tail_end is called at the last end of erofs_mkfs_build_tree, which is of course after traversing all sub-tree inodes. Therefore, erofs_bh_balloon could fail if corresponding block is allocated, fix it. Signed-off-by: Gao Xiang --- Will be wrapped in the original

Re: [PATCH] erofs-utils: correct --with-lz4 example in README

2019-05-31 Thread Gao Xiang via Linux-erofs
On 2019/5/31 ??5:27, Yue Hu wrote: > From: Yue Hu > > Option --with-lz4 means LZ4 install directory rather than LZ4 lib > directory. We will meet configuration error due to wrong path if > setting --with-lz4 to /usr/local/lib. Also stay the same with LZ4 > help in configure shell script.

Re: [PATCH] staging: erofs: return the error value if fill_inline_data() fails

2019-06-25 Thread Gao Xiang via Linux-erofs
On 2019/6/25 3:59, Yue Hu Wrote: > 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 >

Re: [PATCH] staging: erofs: remove unsupported ->datamode check in fill_inline_data()

2019-06-25 Thread Gao Xiang via Linux-erofs
?? 2019/6/25 2:08, Yue Hu : > 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 looks good to me, Reviewed-by: Gao Xiang Thanks, Gao Xiang >

Re: [PATCH] staging: erofs: remove unsupported ->datamode check in fill_inline_data()

2019-06-25 Thread Gao Xiang via Linux-erofs
Hi Yue, On 2019/6/25 2:14, 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 > --- Is there any difference between two patches? Thanks,

Re: [Patch v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG

2019-05-19 Thread Gao Xiang via Linux-erofs
On 2019/5/19 下午5:34, Hariprasad Kelam wrote: > fix below warning reported by coccicheck > > drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON > instead of if condition followed by BUG. > > Signed-off-by: Hariprasad Kelam > - > Changes in v2: > - replace BUG_ON with

[PATCH v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG

2019-05-19 Thread Gao Xiang via Linux-erofs
From: Hariprasad Kelam fix below warning reported by coccicheck drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Signed-off-by: Hariprasad Kelam [ Gao Xiang: use DBG_BUGON instead of BUG_ON for eng version only. ] Signed-off-by: Gao

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

2019-05-06 Thread Gao Xiang via Linux-erofs
Hi Chengguang, On 2019/5/6 ??7:01, Chengguang Xu wrote: > 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 Thanks for catching this issue and it makes sense.

Re: [PATCH] staging: erofs: a few minor style fixes found using checkpatch

2019-07-16 Thread Gao Xiang via Linux-erofs
On 2019/7/17 12:35, Karen Palacio wrote: > Fix camel case use in variable names, > Fix multiple assignments done in a single line, > Fix end of line containing '('. One type one patch... > > Signed-off-by: Karen Palacio > --- > drivers/staging/erofs/super.c | 55 >

Re: [PATCH] staging: erofs: a few minor style fixes found using checkpatch

2019-07-16 Thread Gao Xiang via Linux-erofs
Hi Karen, On 2019/7/17 ??2:56, Karen Palacio wrote: > Hello, thanks for the fast reply.?? > > />NACK, all linux filesystems use Opt_xxx. EROFS should obey this practice. > /I wasn't aware of that convention, my apologies. > > Should I fix that, keep the other changes and resend as v2, or >

Re: [PATCH v2] erofs-utils: code for handling incorrect debug level.

2019-08-04 Thread Gao Xiang via Linux-erofs
On Sun, Aug 04, 2019 at 01:49:43PM +0530, Pratik Shinde wrote: > handling the case of incorrect debug level. > Added an enumerated type for supported debug levels. > Using 'atoi' in place of 'parse_num_from_str'. > > Signed-off-by: Pratik Shinde > --- > include/erofs/print.h | 18

Re: [PATCH v2] erofs-utils: code for handling incorrect debug level.

2019-08-04 Thread Gao Xiang via Linux-erofs
Hi Guifu, On Sun, Aug 04, 2019 at 08:57:58PM +0800, Li Guifu wrote: > Shinde and Gao > Does the variable name of debug level use another name ? like d ? > The i is usual a temporary increase or decrease self variable. I think we can use a common varible name in order to avoid too many

Re: [PATCH v2] erofs-utils: code for handling incorrect debug level.

2019-08-04 Thread Gao Xiang via Linux-erofs
Hi Guifu, On Sun, Aug 04, 2019 at 11:41:47PM +0800, Li Guifu wrote: > GAO > it's a good suggest, you're right I know that you don't have outgoing email permission when you are at work. I think you need to request this permission from your boss again. And could you take some spare time off

  1   2   3   4   5   >