Re: [PATCH v3 1/2] staging: erofs: support statx

2019-05-27 Thread Chao Yu
On 2019/5/28 11:19, Gao Xiang wrote: > statx() has already been supported in commit a528d35e8bfc > ("statx: Add a system call to make enhanced file info available"), > user programs can get more useful attributes. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH v2 2/2] staging: erofs: fix i_blocks calculation

2019-05-27 Thread Chao Yu
On 2019/5/28 10:36, Gao Xiang wrote: > For compressed files, i_blocks should not be calculated > by using i_size. i_u.compressed_blocks is used instead. > > In addition, i_blocks was miscalculated for non-compressed > files previously, fix it as well. > > Signed-off-by: Gao Xiang > --- > change

Re: [PATCH 1/2] staging: erofs: support statx

2019-05-27 Thread Chao Yu
On 2019/5/28 10:31, Gao Xiang wrote: > statx() has already been supported in commit a528d35e8bfc > ("statx: Add a system call to make enhanced file info available"), > user programs can get more useful attributes. > > Signed-off-by: Gao Xiang > --- > drivers/staging/erofs/inode.c| 18

Re: [PATCH 2/3] mm: remove cleancache.c

2019-05-27 Thread Chao Yu
| 9 -- > fs/btrfs/super.c | 2 - > fs/ext4/readpage.c | 6 - > fs/ext4/super.c | 2 - > fs/f2fs/data.c | 3 +- For erofs and f2fs part, Acked-by: Chao Yu Thanks, > fs/mpage.c

Re: [PATCH] erofs-utils: fix an uninitialized variable

2019-05-24 Thread Chao Yu
On 2019/5/23 12:57, Lianjun Huang wrote: > This fixes a building failure caused by using a variable before > initialization. > > Signed-off-by: Lianjun Huang Reviewed-by: Chao Yu Thanks,

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

2019-05-19 Thread Chao Yu
iang: use DBG_BUGON instead of BUG_ON for eng version only. ] > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH] staging: erofs: drop unneeded -Wall addition

2019-05-15 Thread Chao Yu
-by: Masahiro Yamada Reviewed-by: Chao Yu Thanks,

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

2019-05-06 Thread Chao Yu
On 2019/5/6 19: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 Reviewed-by: Chao Yu Thanks,

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

2019-04-12 Thread Chao Yu
email. It will be better to add link address of discussion thread in your commit message, since discussion includes more details about how this issue happens. > > Suggested-by: Ming Lei > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, > --- > > It should be fixed from

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

2019-03-29 Thread Chao Yu
6e52 ("staging: erofs: add directory operations") > Cc: # 4.19+ > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH v2 3/3] staging: erofs: support IO read error injection

2019-03-24 Thread Chao Yu
sponding bdev inode; > 2) get super_block dynamically for compressed bios, >therefore it could not inject bios full of staging >pages, yet it doesn't affect the normal usage. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/3] staging: erofs: fix error handling when failed to read compresssed data

2019-03-24 Thread Chao Yu
On 2019/3/22 11:25, Gao Xiang wrote: > ping? > > Hi Chao, > could you take some time looking into this series? Done, sorry for the delay. Thanks, > > Thanks, > Gao Xiang > > On 2019/3/19 21:54, Gao Xiang wrote: >> Complete read error handling paths for all three kinds of >> compressed pages:

Re: [PATCH 1/3] staging: erofs: fix error handling when failed to read compresssed data

2019-03-24 Thread Chao Yu
. > > Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") > Cc: # 4.19+ > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/3] staging: erofs: introduce erofs_page_is_managed()

2019-03-24 Thread Chao Yu
On 2019/3/19 21:55, Gao Xiang wrote: > 1) In order to clean up unnecessary >page->mapping == MNGD_MAPPING(sbi) wrapped by #ifdefs; > > 2) Needed by "staging: erofs: support IO read error injection". > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

[PATCH] staging: erofs: fix to handle error path of erofs_vmap()

2019-03-11 Thread Chao Yu
From: Chao Yu erofs_vmap() wrapped vmap() and vm_map_ram() to return virtual continuous memory, but both of them can failed due to a lot of reason, previously, erofs_vmap()'s callers didn't handle them, which can potentially cause NULL pointer access, fix it. Fixes: 3883a79abd02 ("st

[PATCH] staging: erofs: fix to handle error path of erofs_vmap()

2019-03-11 Thread Chao Yu
erofs_vmap() wrapped vmap() and vm_map_ram() to return virtual continuous memory, but both of them can failed due to a lot of reason, previously, erofs_vmap()'s callers didn't handle them, which can potentially cause NULL pointer access, fix it. Signed-off-by: Gao Xiang Signed-off-by: Chao Yu

Re: [PATCH 2/3] staging: erofs: fix illegal address access under memory pressure

2019-02-27 Thread Chao Yu
.018157s][] handle_mm_fault+0x7c/0x118 > <4>[1051408.018157s][] do_page_fault+0x354/0x474 > <4>[1051408.018157s][] do_translation_fault+0x40/0x48 > <4>[1051408.018157s][] do_mem_abort+0x80/0x100 > <4>[1051408.018310s]---[ end trace 9f4009a3283bd78b ]--- > > Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") > Cc: # 4.19+ > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/2] staging: erofs: switch to ->iterate_shared()

2019-02-24 Thread Chao Yu
On 2019/2/21 10:34, Gao Xiang wrote: > After commit 6192269444eb ("introduce a parallel variant of ->iterate()"), > readdir can be done without taking exclusive inode lock of course. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/2] staging: erofs: no need to take page lock in readdir

2019-02-24 Thread Chao Yu
On 2019/2/21 10:34, Gao Xiang wrote: > VFS will take inode_lock for readdir, therefore no need to > take page lock in readdir at all just as the majority of > other generic filesystems. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH] staging: erofs: remove rcu_read_lock() in erofs_try_to_free_cached_page

2019-02-19 Thread Chao Yu
On 2019/2/16 16:46, Gao Xiang wrote: > page_private(page) cannot be changed if page lock is taken. > > Besides, the corresponding workgroup won't be freed > if the page is already protected by page lock, therefore > no need to take rcu read lock. > > Signed-off-by: Gao Xian

Re: [Outreachy Kernel][PATCH v2] staging: erofs: match alignment with open parentheses

2019-02-19 Thread Chao Yu
On 2019/2/19 18:24, Gao Xiang wrote: > [+cc linux-erofs and staging mailing list] > > On 2019/2/19 17:25, Bhanusree Pola wrote: >> Align code with open parantheses to improve the readability. >> Issue found using checkpatch.pl >> >> Signed-off-by: Bhanusree Pola Reviewed-by: Chao Yu Thanks,

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

2019-02-17 Thread Chao Yu
Hi Xiang, On 2019/2/18 10:17, Gao Xiang wrote: > Hi Chao, > > On 2019/2/18 9:39, Chao Yu wrote: >> If the image is corrupted, qn->name[i] may be anything, as you commented >> above DBG_BUGON(), we really don't need to go through any later codes, it >> can avoid

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

2019-02-17 Thread Chao Yu
On 2019/2/15 17:35, Dan Carpenter wrote: > On Fri, Feb 15, 2019 at 05:32:33PM +0800, Chao Yu wrote: >> On 2019/2/15 15:57, Dan Carpenter wrote: >>> On Fri, Feb 15, 2019 at 03:02:25PM +0800, Chao Yu wrote: >>>> On 2019/2/1 20:16, Gao Xiang wrote: >>>>&

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

2019-02-17 Thread Chao Yu
Hi xiang, On 2019/2/15 16:58, Gao Xiang wrote: > Hi Chao, > > On 2019/2/15 15:02, Chao Yu wrote: >> 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 = le1

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

2019-02-15 Thread Chao Yu
On 2019/2/15 15:57, Dan Carpenter wrote: > On Fri, Feb 15, 2019 at 03:02:25PM +0800, Chao Yu wrote: >> On 2019/2/1 20:16, Gao Xiang wrote: >>> + /* >>> +* on-disk error, let's only BUG_ON in the debugging mode. >>> +* otherwise, it will re

Re: [PREVIEW] [PATCH] staging: erofs: fix race of initializing xattrs of a inode at the same time

2019-02-14 Thread Chao Yu
On 2019/2/14 23:34, Gao Xiang wrote: > In real scenario, there could be several threads accessing xattrs > of the same xattr-uninitialized inode, and init_inode_xattrs() > almost at the same time. Yeah, nice catch! > > That's actually an unexpected behavior, this patch closes the race. > >

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

2019-02-14 Thread Chao Yu
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 qstr dname = QSTR_INIT(data + nameoff, >

Re: [PATCH v2] staging: erofs: fix memleak of inode's shared xattr array

2019-02-14 Thread Chao Yu
ce catch! >> >> Signed-off-by: Sheng Yong > > LGTM, > > Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support") > Cc: # 4.19+ > Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Thanks, > > [and there is also another race c

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

2019-02-14 Thread Chao Yu
Hi Dan, Any suggestion? On 2019/2/3 10:52, Chao Yu wrote: > Sorry for the delay due to business travel. > > On 2019/1/29 2:30, Dan Carpenter wrote: >> On Tue, Jan 29, 2019 at 12:41:55AM +0800, Chao Yu wrote: >>> Hi Dan and Xiang, >>> >>> On 201

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

2019-02-12 Thread Chao Yu
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 two similar issues, if you can merge them, it will be better. Reviewed-by: Chao Yu Thanks,

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

2019-02-12 Thread Chao Yu
On 2019/2/12 11:24, Chengguang Xu wrote: > unlikely has already included in IS_ERR(), > so just remove redundant likely/unlikely > annotation. > > Signed-off-by: Chengguang Xu Reviewed-by: Chao Yu Thanks,

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

2019-02-02 Thread Chao Yu
Sorry for the delay due to business travel. On 2019/1/29 2:30, Dan Carpenter wrote: > On Tue, Jan 29, 2019 at 12:41:55AM +0800, Chao Yu wrote: >> Hi Dan and Xiang, >> >> On 2019-1-28 21:48, Gao Xiang wrote: >>> Hi Dan, >>> >>> On 2019/1/28 21:

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

2019-01-28 Thread Chao Yu
gt; > The fault injection subsystem was introduced in the initial upstreamed > EROFS version, which is taken from f2fs by Chao Yu. > > Fault injection is important to test fs.. However, I have no more idea > about the future plan of this feature...Follow f2fs or use the general > fault in

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

2019-01-25 Thread Chao Yu
log v3: > - kvmalloc -> erofs_kmalloc suggested by Chao; > - update SB_POSIXACL for the remount case as well; Oh, correct, remount case, I missed that one. It looks good to me now. :) Reviewed-by: Chao Yu Thanks,

Re: [PATCH 5/5] staging: erofs: drop the extern prefix for function definitions

2019-01-16 Thread Chao Yu
On 2019/1/16 16:59, Gao Xiang wrote: > Fix all `CHECK: extern prototypes should be avoided in .h files' > reported by checkpatch.pl. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 4/5] staging: erofs: staticize erofs_shrink_count, erofs_shrink_scan

2019-01-16 Thread Chao Yu
On 2019/1/16 16:59, Gao Xiang wrote: > Move erofs_shrinker_info to utils.c and therefore > no need to globalize erofs_shrink_count and erofs_shrink_scan. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 3/5] staging: erofs: decrease the shrink count in erofs_workgroup_get

2019-01-16 Thread Chao Yu
On 2019/1/16 16:59, Gao Xiang wrote: > It is more suitable to update in erofs_workgroup_get since > it's actually the one matched with erofs_workgroup_put. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/5] staging: erofs: localize erofs_workgroup_get

2019-01-16 Thread Chao Yu
On 2019/1/16 16:59, Gao Xiang wrote: > Staticize erofs_workgroup_get since no external user > out of utils.c directly calls erofs_workgroup_get. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/5] staging: erofs: sunset erofs_workstation_cleanup_all

2019-01-16 Thread Chao Yu
On 2019/1/16 16:59, Gao Xiang wrote: > There is only one user calling erofs_workstation_cleanup_all, > and it is no likely that more users will use in that way > in the future. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

[PATCH v2 5/5] staging: erofs: clean up erofs_map_blocks_iter

2019-01-14 Thread Chao Yu
This patch cleans up erofs_map_blocks* function and structure family, just simply the code, no logic change. Reviewed-by: Gao Xiang Signed-off-by: Chao Yu Signed-off-by: Gao Xiang --- v2: - remove unneed semicolon in definition of z_erofs_map_blocks_iter drivers/staging/erofs/data.c | 31

[PATCH v3] staging: erofs: clean up erofs_map_blocks_iter

2019-01-09 Thread Chao Yu
This patch cleans up erofs_map_blocks* function and structure family, just simply the code, no logic change. Signed-off-by: Chao Yu --- v3: - more cleanup pointed out by Xiang. drivers/staging/erofs/data.c | 37 +-- drivers/staging/erofs/internal.h | 23

[PATCH v2] staging: erofs: clean up erofs_map_blocks_iter

2019-01-09 Thread Chao Yu
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 CONFIG_EROFS_FS_ZIP is not defined - use inner funct

[PATCH] staging: erofs: clean up erofs_map_blocks_iter

2019-01-09 Thread Chao Yu
Signed-off-by: Chao Yu --- v2: - fix to handle map->mpage correctly in erofs_map_blocks - fix to add definition if CONFIG_EROFS_FS_ZIP is not defined - use inner function z_erofs_map_blocks_iter in unzip_vle.c drivers/staging/erofs/data.c | 40 +++ driv

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

2019-01-09 Thread Chao Yu
Hi Xiang, Thanks for the review, let me fix them all and send v2. :) Thanks, On 2019/1/9 19:54, Gao Xiang wrote: > Hi Chao, > > On 2019/1/9 17:46, Chao Yu wrote: >> This patch cleans up erofs_map_blocks* function and structure family, >> just simply the code, no logic cha

[PATCH] staging: erofs: clean up erofs_map_blocks_iter

2019-01-09 Thread Chao Yu
This patch cleans up erofs_map_blocks* function and structure family, just simply the code, no logic change. Signed-off-by: Chao Yu --- drivers/staging/erofs/data.c | 40 +++ drivers/staging/erofs/internal.h | 16 ++--- drivers/staging/erofs/unzip_vle.c

Re: [PREVIEW] [PATCH v2 2/3] staging: erofs: remove unneeded inode_operations

2019-01-03 Thread Chao Yu
On 2019/1/4 10:11, Gao Xiang wrote: > Hi Chao, > > On 2019/1/4 9:24, Chao Yu wrote: >> On 2018/12/29 22:01, Gao Xiang wrote: >>> Currently, EROFS uses generic iops when xattr is off, >>> it seems unnecessary and a lot of extra code is there. >>> Let'

Re: [PREVIEW] [PATCH v2 2/3] staging: erofs: remove unneeded inode_operations

2019-01-03 Thread Chao Yu
On 2018/12/29 22:01, Gao Xiang wrote: > Currently, EROFS uses generic iops when xattr is off, > it seems unnecessary and a lot of extra code is there. > Let's follow what other filesystems do instead. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PREVIEW] [PATCH v2 1/3] staging: erofs: fix fast symlink w/o xattr when fs xattr is on

2019-01-03 Thread Chao Yu
_xattrs(), > and it also fixes improper return value -ENOTSUPP > (it should be -ENODATA if xattr is enabled) for those inodes. > > Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support") > Reported-by: Li Guifu > Tested-by: Li Guifu > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH] staging: erofs: fix return type of erofs_workgroup_get

2018-12-25 Thread Chao Yu
On 2018/12/26 11:34, Gao Xiang wrote: > There exists a return type misuse (`int'->`bool') since all > users assume it fails if only return value != 0, let's fix > the return type to `int' instead of confusing `bool'. > > No logic changes. > > Signed-off-by: Gao Xian

Re: [PATCH] staging: erofs: remove __EROFS_BIT

2018-12-12 Thread Chao Yu
by: Gao Xiang It looks this patch has been merged, anyway Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/2] staging: erofs: unzip_vle_lz4.c,utils.c: rectify BUG_ONs

2018-12-10 Thread Chao Yu
On 2018/12/11 15:17, Gao Xiang wrote: > remove all redundant BUG_ONs, and turn the rest > useful usages to DBG_BUGONs. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/2] staging: erofs: unzip_{pagevec.h,vle.c}: rectify BUG_ONs

2018-12-10 Thread Chao Yu
On 2018/12/11 15:17, Gao Xiang wrote: > remove all redundant BUG_ONs, and turn the rest > useful usages to DBG_BUGONs. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev 5/7] staging: erofs: refine compressed pages preloading flow

2018-12-06 Thread Chao Yu
using tagged pointer, too many #ifdefs are removed as well. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev 4/7] staging: erofs: revisit page submission flow

2018-12-06 Thread Chao Yu
ll. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev 3/7] staging: erofs: localize UNALLOCATED_CACHED_PAGE placeholder

2018-12-06 Thread Chao Yu
be replaced at the time > of submission. > > Previously EROFS_UNALLOCATED_CACHED_PAGE was included in internal.h, > which is unnecessary since it's only internally used in decompression > subsystem, move it to unzip_vle.c and rename it to PAGE_UNALLOCATED. > > Signed-off-by:

Re: [PATCH chao/erofs-dev 2/7] staging: erofs: introduce MNGD_MAPPING helper

2018-12-06 Thread Chao Yu
On 2018-12-2 2:32, Gao Xiang wrote: > This patch introduces MNGD_MAPPING to wrap up > sbi->managed_cache->i_mapping, which will be used > to solve too many #ifdef in a single function. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev 1/7] staging: erofs: fix use-after-free of on-stack `z_erofs_vle_unzip_io'

2018-12-06 Thread Chao Yu
_one_work+0x188/0x4b4 > [] worker_thread+0x140/0x458 > [] kthread+0xec/0x108 > [] ret_from_fork+0x10/0x1c > Code: d1006273 54000260 f9400804 b9400019 (b85fc081) > ---[ end trace be9dde154f677cd1 ]--- > > Signed-off-by: Gao Xiang > --- > Hi Chao, > could you please kindly update this patch series and > take a look them all? Thanks in advance. Sorry for the delay. Reviewed-by: Chao Yu Thanks,

Re: [RFC PATCH v2 chao/erofs-dev 1/5] staging: erofs: rename strange variable names in z_erofs_vle_frontend

2018-11-20 Thread Chao Yu
iang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 11/12] staging: erofs: locked before registering for all new workgroups

2018-11-19 Thread Chao Yu
ould turn into the in-place > decompression rather than use as the cached decompression. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 10/12] staging: erofs: separate into init_once / always

2018-11-19 Thread Chao Yu
einitialized to meaningful values later, > and pagevec is no need to initialized at all. > > Signed-off-by: Gao Xiang In [09/12], it says: drivers/staging/erofs/unzip_vle.c: In function ‘init_always But actually, we introduce it in [10/12]. So this patch should be relocated

Re: [PATCH chao/erofs-dev rebased v2 09/12] staging: erofs: fix the definition of DBG_BUGON

2018-11-19 Thread Chao Yu
s/unzip_vle.c:61:33: warning: unused variable ‘work’ > [-Wunused-variable] > struct z_erofs_vle_work *const work = > ^~~~ > > Fix it to #define DBG_BUGON(x) ((void)(x)). > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 07/12] staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}'

2018-11-19 Thread Chao Yu
preemption before > doing atomic_cmpxchg in case that some high priority tasks > preempt between atomic_cmpxchg and disable_preempt, then spin > on the locked refcount later. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 06/12] staging: erofs: atomic_cond_read_relaxed on ref-locked workgroup

2018-11-19 Thread Chao Yu
On 2018/11/14 23:25, Gao Xiang wrote: > 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. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 05/12] staging: erofs: fix race when the managed cache is enabled

2018-11-19 Thread Chao Yu
2 (cannot be freezed). > + */ > + atomic_dec(>refcount); How about: #define __erofs_workgroup_put(grp) atomic_dec(>refcount); Otherwise, it looks good to me. Reviewed-by: Chao Yu Thanks, > > erofs_workstn_unlock(sbi); > radix

Re: [PATCH 3/3] staging: erofs: unzip_vle.c: Align parameter to the parentesis

2018-11-15 Thread Chao Yu
On 2018/11/13 4:43, Cristian Sicilia wrote: > Align parameters to the opened parentesis. > > Signed-off-by: Cristian Sicilia Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/3] staging: erofs: unzip_vle.c: Constant in comparison on right side

2018-11-15 Thread Chao Yu
On 2018/11/13 4:43, Cristian Sicilia wrote: > Comparisons should place the constant > on the right side of the test. > > Signed-off-by: Cristian Sicilia Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/3] staging: erofs: unzip_vle.c: Replace comparison to NULL.

2018-11-15 Thread Chao Yu
On 2018/11/13 4:43, Cristian Sicilia wrote: > Replace equal to NULL with logic unary operator, > and removing not equal to NULL comparison. > > Signed-off-by: Cristian Sicilia Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 01/12] staging: erofs: unzip_vle.c: Replace comparison to NULL.

2018-11-15 Thread Chao Yu
Hi Xiang, On 2018/11/16 10:55, Gao Xiang wrote: > Hi Chao, > > On 2018/11/16 10:53, Chao Yu wrote: >> On 2018/11/14 23:25, Gao Xiang wrote: >>> From: Cristian Sicilia >>> >>> Replace equal to NULL with logic unary operator, >>> and removi

Re: [PATCH chao/erofs-dev rebased v2 04/12] staging: erofs: fix `trace_erofs_readpage' position

2018-11-15 Thread Chao Yu
ng > Reviewed-by: Chen Gong Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 02/12] staging: erofs: unzip_vle.c: Constant in comparison on right side

2018-11-15 Thread Chao Yu
On 2018/11/14 23:25, Gao Xiang wrote: > From: Cristian Sicilia > > Comparisons should place the constant > on the right side of the test. > > Signed-off-by: Cristian Sicilia Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 03/12] staging: erofs: unzip_vle.c: Align parameter to the parentesis

2018-11-15 Thread Chao Yu
On 2018/11/14 23:25, Gao Xiang wrote: > From: Cristian Sicilia > > Align parameters to the opened parentesis. > > Signed-off-by: Cristian Sicilia Reviewed-by: Chao Yu Thanks,

Re: [PATCH chao/erofs-dev rebased v2 01/12] staging: erofs: unzip_vle.c: Replace comparison to NULL.

2018-11-15 Thread Chao Yu
On 2018/11/14 23:25, Gao Xiang wrote: > From: Cristian Sicilia > > Replace equal to NULL with logic unary operator, > and removing not equal to NULL comparison. > > Signed-off-by: Cristian Sicilia Reviewed-by: Chao Yu Thanks,

Re: [PATCH] staging: erofs: use the new LZ4_decompress_safe_partial()

2018-11-07 Thread Chao Yu
leaned compressor wrapper will be introduced in the subsequent > patches in order to prepare for supporting multiple compression algorithms. > > Signed-off-by: Gao Xiang > --- > > Hi Chao, > Could you please kindly confirm (review) this before merging into the > stagi

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

2018-11-04 Thread Chao Yu
Hi Xiang, On 2018/11/5 9:36, Gao Xiang wrote: > Hi Chao, > > On 2018/11/5 9:30, Chao Yu wrote: >> Hi Xiang, >> >> On 2018/11/4 23:52, Gao Xiang wrote: >>> Hi Chao, >>> >>> On 2018/11/4 23:35, Chao Yu wrote: >>>> Yes, it needs re

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

2018-11-04 Thread Chao Yu
Hi Xiang, On 2018/11/4 23:52, Gao Xiang wrote: > 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 r

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

2018-11-04 Thread Chao Yu
Hi Xiang, On 2018-11-4 23:32, Gao Xiang wrote: > Hi Chao, > > On 2018/11/4 23:27, Chao Yu wrote: >> Hi Xiang, >> >> On 2018-11-4 18:04, Gao Xiang via Linux-erofs wrote: >>> Hi Chao, >>> >>> On 2018/11/2 18:26, Chao Yu wrote: >>>>

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

2018-11-04 Thread Chao Yu
Hi Xiang, On 2018-11-4 18:04, Gao Xiang via Linux-erofs wrote: > Hi Chao, > > On 2018/11/2 18:26, Chao Yu wrote: >> Hi Xiang, >> >> On 2018/10/31 10:39, Gao Xiang wrote: >>> Hi Chao, >>> >>> Could you please update chao/erofs-dev branch ba

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

2018-11-02 Thread Chao Yu
bility patches reported by the internal beta > test, > expected to finish this week. :) No problem, let me update them at this weekend... Thanks, > > Thanks, > Gao Xiang > > On 2018/10/31 10:11, Gao Xiang wrote: >> Hi Chao, >> >> On 2018/10/31 10:04, Chao Y

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

2018-11-02 Thread Chao Yu
Hi Xiang, On 2018/10/31 10:11, Gao Xiang wrote: > Hi Chao, > > On 2018/10/31 10:04, Chao Yu wrote: >> On 2018/10/19 14:41, Gao Xiang wrote: >>> `z_erofs_vle_workgroup' is heavily generated in the decompression, >>> for example, it resets 32 bytes redundantly for

Re: [PATCH] clean erofs_lookup()

2018-10-16 Thread Chao Yu
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. > > Signed-off-by: Al Viro Reviewed-by: Chao Yu Thanks,

Re: [PATCH] staging: erofs: add the missing __init tags

2018-10-16 Thread Chao Yu
On 2018/10/9 21:43, Gao Xiang wrote: > Append __init to `erofs_init_inode_cache', > `z_erofs_init_zip_subsystem' and move these > declarations to internal.h. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PREVIEW] [PATCH chao/erofs-dev 3/3] staging: erofs: managed pages could be locked at the time of decompression

2018-10-01 Thread Chao Yu
s > the reclaim path. Let's remove the related assertion in decompression. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

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

2018-10-01 Thread Chao Yu
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 harmful. Could you add related race condition stack

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

2018-09-30 Thread Chao Yu
vers/staging/erofs/internal.h > +++ b/drivers/staging/erofs/internal.h > @@ -511,6 +511,15 @@ erofs_get_inline_page(struct inode *inode, > } > > /* inode.c */ > +static inline unsigned long erofs_inode_hash(erofs_nid_t nid) > +{ > +#if BITS_PER_LONG == 32 > + return (nid >> 32) ^ (nid & 0x); > +#else > + return nid; > +#endif That's the right way. :) Reviewed-by: Chao Yu Thanks, > +} > + > extern struct inode *erofs_iget(struct super_block *sb, > erofs_nid_t nid, bool dir); > >

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

2018-09-30 Thread Chao Yu
On 2018-10-1 10:40, Gao Xiang wrote: > 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.

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

2018-09-19 Thread Chao Yu
On 2018/9/20 7:34, cgxu519 wrote: > On 9/19/18 11:22 PM, Gao Xiang wrote: >> 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

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

2018-09-19 Thread Chao Yu
On 2018/9/20 0:06, Gao Xiang wrote: > From: Gao Xiang > > This patch introduces `__should_decompress_synchronously' to > cleanup `z_erofs_vle_normalaccess_readpages'. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

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

2018-09-19 Thread Chao Yu
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 `z_erofs_vle_normal

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

2018-09-19 Thread Chao Yu
Hi Xiang, On 2018/9/19 13:49, Gao Xiang wrote: > 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 +

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

2018-09-19 Thread Chao Yu
On 2018/9/19 13:49, Gao Xiang wrote: > 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 Reviewed-by: Chao Yu Thanks,

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

2018-09-19 Thread Chao Yu
On 2018/9/19 13:49, Gao Xiang wrote: > some CONFIG_EROFS_FS_XATTR conditions were added because of > the historial Linux kernel compatibility, which are unneeded now. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

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
atch is related to your [PATCH 6/6], so I think they can be merge to one, so the purpose of patch can be more clear. Anyway, it's not a big deal. you can add: Reviewed-by: Chao Yu Thanks,

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 2/7] staging: erofs: code cleanup for option parsing of fault_injection

2018-09-17 Thread Chao Yu
On 2018/9/17 21:52, cgxu519 wrote: > On 09/14/2018 11:22 PM, Chao Yu wrote: >> On 2018/9/13 13:46, cgxu519 wrote: >>> On 09/13/2018 10:15 AM, Chao Yu wrote: >>>> On 2018/9/12 13:10, Chengguang Xu wrote: >>>>> Define a dummpy fu

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

2018-09-14 Thread Chao Yu
On 2018/9/13 13:46, cgxu519 wrote: > On 09/13/2018 10:15 AM, Chao Yu wrote: >> On 2018/9/12 13: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 >>&

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

2018-09-12 Thread Chao Yu
On 2018/9/12 13: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 of

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

2018-09-11 Thread Chao Yu
slightly change warning message to keep consistency with > option POSIX_ACL and FS_XATTR. > > Signed-off-by: Chengguang Xu Prefix of patch title should be "staging: erofs: " as Xiang pointed out, otherwise it looks good to me, you can add: Reviewed-by: Chao Yu Thanks,

<    1   2   3   4   5   6   7   >