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

2019-02-24 Thread Gao Xiang
On 2019/2/25 9:36, Chao Yu wrote: > 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

[PATCH 1/3] staging: erofs: compressed_pages should not be accessed again after freed

2019-02-26 Thread Gao Xiang
decompression support") Cc: # 4.19+ Signed-off-by: Gao Xiang --- drivers/staging/erofs/unzip_vle.c | 38 ++- drivers/staging/erofs/unzip_vle.h | 3 +-- drivers/staging/erofs/unzip_vle_lz4.c | 19 -- 3 files changed, 29 insertions(+), 31

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

2019-02-26 Thread Gao Xiang
27s][] __handle_mm_fault+0xac/0xf4 <4>[1051408.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 tr

[PATCH 3/3] staging: erofs: fix mis-acted TAIL merging behavior

2019-02-26 Thread Gao Xiang
hain 2 decompresses ahead of chain 1, it will be a race and lead to corrupted decompressed page. This patch fixes it. Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") Cc: # 4.19+ Signed-off-by: Gao Xiang --- drivers/staging/erofs/

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

2019-03-03 Thread Gao Xiang
el/git/gregkh/staging.git/commit/drivers/staging/erofs/dir.c?h=staging-next&id=cbebe5d05dd7fe2fdd13cff7c4a62f22109f1f95 Thanks, Gao Xiang > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c > index 833f052f

Re: [PATCH] staging: erofs: add a new line after variable declaration

2019-03-09 Thread Gao Xiang
Hi Julio, On 2019/3/10 1:08, Julio Bianco wrote: > Add a new line after variable declaration > > Signed-off-by: Julio Bianco There is the only place in erofs for this issue? Could you check and please fix them all if you have some time? Thanks, Gao Xiang > --- > drivers/stagin

Re: [PATCH] [PATCH 1/1] staging: erofs: Add function comment for erofs/super.c

2019-03-12 Thread Gao Xiang
BTW, no need to duplicate [PATCH] [PATCH 1/1], the subject line can just be [PATCH] staging: erofs: Add function comment for erofs/super.c Thanks, Gao Xiang > drivers/staging/erofs/super.c | 135 > -- > 1 file changed, 131 insertions(+), 4 deleti

Re: [PATCH] staging: erofs: fix parenthesis alignment

2019-03-18 Thread Gao Xiang
On 2019/3/18 12:14, Julian Merida wrote: > Fix all checkpatch issues: "CHECK: Alignment should match open parenthesis" > > Signed-off-by: Julian Merida looks good to me personally, you can add: Reviewed-by: Gao Xiang btw, I cc greg and staging mailing list, could you

Re: [PATCH v3] staging: erofs: Add whitespace after declaration

2019-03-18 Thread Gao Xiang
Actually a duplicate commit, see: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?h=staging-next&id=8af36478f9516d51fcfedf9b9ed8905a1c00d278 several people submit patches on this line in erofs_iget() Thanks, Gao Xiang > > thanks, > > greg k-h >

Re: [PATCH] staging: erofs: fix parenthesis alignment

2019-03-19 Thread Gao Xiang
Hi Greg, On 2019/3/19 21:28, Greg KH wrote: > On Mon, Mar 18, 2019 at 08:58:41PM -0300, Julian Merida wrote: >> Fix all checkpatch issues: "CHECK: Alignment should match open parenthesis" >> >> Signed-off-by: Julian Merida >> Reviewed-by: Gao Xiang > >

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

2019-03-19 Thread Gao Xiang
ios, therefore it could not inject bios full of staging pages, yet it doesn't affect the normal usage. Signed-off-by: Gao Xiang --- drivers/staging/erofs/Documentation/filesystems/erofs.txt | 1 + drivers/staging/erofs/data.c | 10 +- drivers/stagi

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

2019-03-19 Thread Gao Xiang
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 --- drivers/staging/erofs/internal.h | 7 +++ drivers/staging/erofs/unz

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

2019-03-19 Thread Gao Xiang
Signed-off-by: Gao Xiang --- This series focus on fixing error handling when failed to read compresssed data due to previous incomplete paths. In addition, the last 2 patches add IO error fault injection for reading paths, which I have used to test the first patch as well. Thanks, Gao Xiang

Re: [PATCH] staging: erofs: fix parenthesis alignment

2019-03-19 Thread Gao Xiang
> > Gao then told me I should send the patch to you and to the staging mail list. > > Regards, > Julián Mérida [ kindly reminder: It is preferred to send in plain text rather than html format since a lot of community guys and mailing lists could treat them as spam emails...] Good

Re: [PATCH] staging: erofs: fix parenthesis alignment

2019-03-19 Thread Gao Xiang
On 2019/3/20 11:22, Gao Xiang wrote: > Hi Julian, > > On 2019/3/20 1:19, Julian Merida wrote: >> Yes that was my mistake, I'm really sorry!! This was my first contribution >> to the kernel and I didn't know who to send the email despite the >> maintainer

[PATCH v3] staging: erofs: Use !x or x in place of NULL comparision

2019-03-21 Thread Gao Xiang
\)(...)); -if(x==NULL) +if(!x) S @@ expression e; @@ -e == NULL +!e // Signed-off-by: Bhanusree Pola [ Gao Xiang: fix x != NULL comparision to x as well. ] Signed-off-by: Gao Xiang --- change log v3: - based on Bhanusree's patch; - rebase code and fix x != NULL comparision to x as

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

2019-03-21 Thread Gao Xiang
ping? Hi Chao, could you take some time looking into this series? Thanks, Gao Xiang On 2019/3/19 21:54, Gao Xiang wrote: > Complete read error handling paths for all three kinds of > compressed pages: > > 1) For cache-managed pages, PG_uptodate will be checked since >

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

2019-03-24 Thread Gao Xiang
Hi Chao, On 2019/3/25 9:47, Chao Yu wrote: > On 2019/3/19 21:55, Gao Xiang wrote: >> Used to simulate disk IO read error for testing fatal >> error tolerance. >> >> Here are the details, >> 1) use bio->bi_private to indicate super_block >>for n

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

2019-03-24 Thread Gao Xiang
Hi Chao, On 2019/3/25 10:05, Chao Yu wrote: > 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. It doesn't matter. It is helpful for our kernel upgrade since

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

2019-03-24 Thread Gao Xiang
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". Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 7 +++ drivers/staging/erof

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

2019-03-24 Thread Gao Xiang
+ Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- changelog v2: - [3/3] wrap bio->bi_private assignment into erofs_grab_bio() as suggested by Chao; This series focus on fixing error handling when failed to read compresssed data due to previous incomplete paths. In addition, the last 2 p

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

2019-03-24 Thread Gao Xiang
ios, therefore it could not inject bios full of staging pages, yet it doesn't affect the normal usage. Signed-off-by: Gao Xiang --- .../staging/erofs/Documentation/filesystems/erofs.txt | 1 + drivers/staging/erofs/data.c | 18 -- drivers/stagi

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

2019-03-28 Thread Gao Xiang
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+

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

2019-04-01 Thread Gao Xiang
"staging: erofs: introduce erofs_grab_bio") > ab47dd2b0819 ("staging: erofs: cleanup z_erofs_vle_work_{lookup, > register}") > > > How should we proceed with this patch? I have made a 4.19 patch for this: https://lore.

[PATCH v2 06/22] staging: erofs: clean up internal.h

2019-07-31 Thread Gao Xiang
Tidy up relative order of variables / declarations in internal.h, move some local static functions out into other files and add tags at the end of #endif acrossing several lines. No logic change. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/decompressor.c | 27

[PATCH v2 07/22] staging: erofs: remove redundant #include "internal.h"

2019-07-31 Thread Gao Xiang
Because #include "internal.h" is included in xattr.h Signed-off-by: Gao Xiang --- drivers/staging/erofs/namei.c | 1 - drivers/staging/erofs/super.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c index 50

[PATCH v2 17/22] staging: erofs: tidy up decompression frontend

2019-07-31 Thread Gao Xiang
te it. FULL_LENGTH bit is integrated into .length of pcluster so that it can be updated with the corresponding length change in atomic. Minor, add comments for better description. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/zdata.c

[PATCH v2 05/22] staging: erofs: sunset erofs_workstn_{lock,unlock}

2019-07-31 Thread Gao Xiang
It was used for Linux backward compatibility, and no use for upstream kernel. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 3 --- drivers/staging/erofs/utils.c| 10 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v2 01/22] staging: erofs: update source file headers

2019-07-31 Thread Gao Xiang
- Use the correct style for all SPDX License Identifiers; - Get rid of the unnecessary license boilerplate; - Use "GPL-2.0-only" instead of "GPL-2.0" suggested-by Stephen. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/Kconfig

[PATCH v2 03/22] staging: erofs: fix dummy functions erofs_{get, list}xattr

2019-07-31 Thread Gao Xiang
dummy functions erofs_{get,list}xattr should be inlined without xattr enabled. Signed-off-by: Yue Hu [ Gao Xiang : this patch was "staging: erofs: remove needless dummy functions of erofs_{get,list}xattr. "] Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/sta

[PATCH v6 10/24] erofs: update Kconfig and Makefile

2019-08-02 Thread Gao Xiang
This commit adds Makefile and Kconfig for erofs, and updates Makefile and Kconfig files in the fs directory. Signed-off-by: Gao Xiang --- fs/Kconfig| 1 + fs/Makefile | 1 + fs/erofs/Kconfig | 36 fs/erofs/Makefile | 9 + 4 files

[PATCH v6 01/24] erofs: add on-disk layout

2019-08-02 Thread Gao Xiang
This commit adds the on-disk layout header file of erofs. On-disk format is compatible with erofs-staging added in 4.19. In addition, add EROFS_SUPER_MAGIC_V1 to magic.h. Signed-off-by: Gao Xiang --- fs/erofs/erofs_fs.h| 316 + include/uapi/linux

[PATCH v6 07/24] erofs: add directory operations

2019-08-02 Thread Gao Xiang
This adds functions for directory, mainly readdir. Signed-off-by: Gao Xiang --- fs/erofs/dir.c | 147 + 1 file changed, 147 insertions(+) create mode 100644 fs/erofs/dir.c diff --git a/fs/erofs/dir.c b/fs/erofs/dir.c new file mode 100644 index

[PATCH v6 05/24] erofs: add inode operations

2019-08-02 Thread Gao Xiang
This adds core functions to get, read an inode. It adds statx support as well. Signed-off-by: Gao Xiang --- fs/erofs/inode.c | 291 +++ 1 file changed, 291 insertions(+) create mode 100644 fs/erofs/inode.c diff --git a/fs/erofs/inode.c b/fs/erofs

[PATCH v6 09/24] erofs: support tracepoint

2019-08-02 Thread Gao Xiang
Add basic tracepoints for ->readpage{,s}, ->lookup, ->destroy_inode, fill_inode and map_blocks. Signed-off-by: Gao Xiang --- include/trace/events/erofs.h | 241 +++ 1 file changed, 241 insertions(+) create mode 100644 include/trace/events/erofs.h dif

[PATCH v6 03/24] erofs: add super block operations

2019-08-02 Thread Gao Xiang
This commit adds erofs super block operations, including (u)mount, remount_fs, show_options, statfs, in addition to some private icache management functions. Signed-off-by: Gao Xiang --- fs/erofs/super.c | 437 +++ 1 file changed, 437 insertions

[PATCH v6 06/24] erofs: support special inode

2019-08-02 Thread Gao Xiang
This patch adds to support special inode, such as block dev, char, socket, pipe inode. Signed-off-by: Gao Xiang --- fs/erofs/inode.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index b6ea997bc4ae

[PATCH v6 00/24] erofs: promote erofs from staging

2019-08-02 Thread Gao Xiang
x kernel as the other in-kernel filesystems. Kindly share your comments about EROFS. Thank you in advance! Thanks, Gao Xiang Changelog from v5: o keep up with "[PATCH v2] staging: erofs: updates according to erofs-outofstaging v4" https://lore.kernel.org/lkml/20190731155752.21060

[PATCH v6 02/24] erofs: add erofs in-memory stuffs

2019-08-02 Thread Gao Xiang
(). Signed-off-by: Gao Xiang --- fs/erofs/internal.h | 356 1 file changed, 356 insertions(+) create mode 100644 fs/erofs/internal.h diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h new file mode 100644 index ..2c94149d7218 --- /dev/null

[PATCH v6 16/24] erofs: introduce workstation for decompression

2019-08-02 Thread Gao Xiang
future. Signed-off-by: Gao Xiang --- fs/erofs/internal.h | 80 + fs/erofs/super.c| 4 ++ fs/erofs/utils.c| 166 +++- 3 files changed, 248 insertions(+), 2 deletions(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h ind

[PATCH v6 19/24] erofs: add erofs_allocpage()

2019-08-02 Thread Gao Xiang
This patch introduces an temporary _on-stack_ page pool to reuse the freed page directly as much as it can for better performance and release all pages at a time, it also slightly reduces the possibility of the potential memory allocation failure. Signed-off-by: Gao Xiang --- fs/erofs

[PATCH v6 21/24] erofs: introduce LZ4 decompression inplace

2019-08-02 Thread Gao Xiang
d of course (see the following patches for test results). [1] https://github.com/lz4/lz4/commit/b17f578a919b7e6b078cede2d52be29dd48c8e8c https://github.com/lz4/lz4/commit/5997e139f53169fa3a1c1b4418d2452a90b01602 Signed-off-by: Gao Xiang --- fs/erofs/decompre

[PATCH v6 17/24] erofs: introduce per-CPU buffers implementation

2019-08-02 Thread Gao Xiang
x27;s leave it as-is for now. Signed-off-by: Gao Xiang --- fs/erofs/Kconfig| 14 ++ fs/erofs/internal.h | 21 + fs/erofs/utils.c| 12 3 files changed, 47 insertions(+) diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig index a475fbebb831..5f8787c

[PATCH v6 14/24] erofs: introduce superblock registration

2019-08-02 Thread Gao Xiang
In order to introducing shrinker solution for erofs, let's manage all mounted erofs instances at first. Signed-off-by: Gao Xiang --- fs/erofs/Makefile | 2 +- fs/erofs/internal.h | 13 + fs/erofs/super.c| 9 + fs/erofs/utils.c

[PATCH v6 11/24] erofs: introduce xattr & posixacl support

2019-08-02 Thread Gao Xiang
lname: system.posix_acl_default struct erofs_xattr_entry: .e_name_len = 0 .e_name_index = EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT (3) Signed-off-by: Gao Xiang --- fs/erofs/Kconfig| 38 +++ fs/erofs/Makefile | 1 + fs/erofs/inode.c| 14 +- fs/erofs/internal.h | 16

[PATCH v6 22/24] erofs: introduce the decompression frontend

2019-08-02 Thread Gao Xiang
allocation and all extra compressed data memcpy. Signed-off-by: Gao Xiang --- fs/erofs/Kconfig|1 + fs/erofs/Makefile |2 +- fs/erofs/internal.h | 14 +- fs/erofs/super.c| 11 + fs/erofs/zdata.c| 1254 +++ fs/erofs/zdata.h| 192

[PATCH v6 12/24] erofs: introduce tagged pointer

2019-08-02 Thread Gao Xiang
://en.wikipedia.org/wiki/Tagged_pointer Signed-off-by: Gao Xiang --- fs/erofs/tagptr.h | 110 ++ 1 file changed, 110 insertions(+) create mode 100644 fs/erofs/tagptr.h diff --git a/fs/erofs/tagptr.h b/fs/erofs/tagptr.h new file mode 100644 index

[PATCH v6 15/24] erofs: introduce erofs shrinker

2019-08-02 Thread Gao Xiang
bjects. Signed-off-by: Gao Xiang --- fs/erofs/internal.h | 7 fs/erofs/super.c| 6 +++ fs/erofs/utils.c| 93 - 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 082fa4727c80..adc829

[PATCH v6 04/24] erofs: add raw address_space operations

2019-08-02 Thread Gao Xiang
This commit adds functions for meta and raw data, and also provides address_space_operations for raw data access. Signed-off-by: Gao Xiang --- fs/erofs/data.c | 423 1 file changed, 423 insertions(+) create mode 100644 fs/erofs/data.c diff

[PATCH v6 08/24] erofs: add namei functions

2019-08-02 Thread Gao Xiang
This commit adds functions that transfer names to inodes. Signed-off-by: Gao Xiang --- fs/erofs/namei.c | 247 +++ 1 file changed, 247 insertions(+) create mode 100644 fs/erofs/namei.c diff --git a/fs/erofs/namei.c b/fs/erofs/namei.c new file mode

[PATCH v6 13/24] erofs: add compression indexes support

2019-08-02 Thread Gao Xiang
regrab' processes if they request the same meta page. Signed-off-by: Gao Xiang --- fs/erofs/Kconfig | 9 + fs/erofs/Makefile| 1 + fs/erofs/data.c | 10 +- fs/erofs/inode.c | 2 +- fs/erofs/internal.h | 35 ++- fs/e

[PATCH v6 24/24] erofs: add document

2019-08-02 Thread Gao Xiang
This documents key features, usage, and on-disk design of erofs. Signed-off-by: Gao Xiang --- Documentation/filesystems/erofs.txt | 225 1 file changed, 225 insertions(+) create mode 100644 Documentation/filesystems/erofs.txt diff --git a/Documentation/filesystems

[PATCH v6 18/24] erofs: introduce pagevec for decompression subsystem

2019-08-02 Thread Gao Xiang
whole array itself up will be needed. Signed-off-by: Gao Xiang --- fs/erofs/zpvec.h | 159 +++ 1 file changed, 159 insertions(+) create mode 100644 fs/erofs/zpvec.h diff --git a/fs/erofs/zpvec.h b/fs/erofs/zpvec.h new file mode 100644 index

[PATCH v6 20/24] erofs: introduce generic decompression backend

2019-08-02 Thread Gao Xiang
ch. Signed-off-by: Gao Xiang --- fs/erofs/Makefile | 2 +- fs/erofs/compress.h | 62 fs/erofs/decompressor.c | 332 3 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 fs/erofs/compress.h create mode 100644 fs/erofs

[PATCH v6 23/24] erofs: introduce cached decompression

2019-08-02 Thread Gao Xiang
This patch adds strategies which can be selected by users in order to cache both incomplete ends of compressed physical clusters as a complement of in-place I/O in order to boost random read, but it costs more memory than the in-place I/O only. Signed-off-by: Gao Xiang --- fs/erofs/internal.h

[PATCH RFC] erofs: move erofs out of staging

2019-08-06 Thread Gao Xiang
;o Cc: Pavel Machek Cc: David Sterba Cc: Amir Goldstein Cc: Christoph Hellwig Cc: Darrick J . Wong Cc: Dave Chinner Cc: Jaegeuk Kim Cc: Jan Kara Cc: Linus Torvalds Cc: Chao Yu Cc: Miao Xie Cc: Li Guifu Cc: Fang Wei Cc: Cc: Cc: LKML Cc: linux-er...@lists.ozlabs.org Signed-off-by: Gao

Re: [PATCH RFC] erofs: move erofs out of staging

2019-08-06 Thread Gao Xiang
s/namei.c https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/tree/fs/verity/verify.c?h=fsverity I think I can remove these filenames as you suggested in the next version. I thought these are some common practice and there is no obvious right or wrong of this kind of stuffs. Th

[PATCH 1/3] staging: erofs: inline erofs_inode_is_data_compressed()

2019-08-12 Thread Gao Xiang
As a helper in erofs_fs.h, erofs_inode_is_data_compressed() should be inlined. Signed-off-by: Gao Xiang --- drivers/staging/erofs/erofs_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h index e82e833985e4

[PATCH 2/3] staging: erofs: remove incomplete cleancache

2019-08-12 Thread Gao Xiang
cleancache was not fully implemented in EROFS. In addition, it's tend to remove the whole cleancache in related attempt [1]. [1] https://lore.kernel.org/linux-fsdevel/20190527103207.13287-3-jgr...@suse.com/ Signed-off-by: Gao Xiang --- drivers/staging/erofs/data.c | 6 -- dr

[PATCH 3/3] staging: erofs: xattr.c: avoid BUG_ON

2019-08-12 Thread Gao Xiang
Kill all the remaining BUG_ON in EROFS: - one BUG_ON was used to detect xattr on-disk corruption, proper error handling should be added for it instead; - the other BUG_ONs are used to detect potential issues, use DBG_BUGON only in (eng) debugging version. Signed-off-by: Gao Xiang

Re: [PATCH 3/3] staging: erofs: xattr.c: avoid BUG_ON

2019-08-12 Thread Gao Xiang
Hi Chao, On Tue, Aug 13, 2019 at 11:20:22AM +0800, Chao Yu wrote: > On 2019/8/13 10:30, Gao Xiang wrote: > > Kill all the remaining BUG_ON in EROFS: > > - one BUG_ON was used to detect xattr on-disk corruption, > >proper error handling should be added for it instead; >

[PATCH v7 10/24] erofs: update Kconfig and Makefile

2019-08-13 Thread Gao Xiang
This commit adds Makefile and Kconfig for erofs, and updates Makefile and Kconfig files in the fs directory. Signed-off-by: Gao Xiang --- fs/Kconfig| 1 + fs/Makefile | 1 + fs/erofs/Kconfig | 36 fs/erofs/Makefile | 9 + 4 files

[PATCH v7 02/24] erofs: add erofs in-memory stuffs

2019-08-13 Thread Gao Xiang
(). Signed-off-by: Gao Xiang --- fs/erofs/internal.h | 355 1 file changed, 355 insertions(+) create mode 100644 fs/erofs/internal.h diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h new file mode 100644 index ..f20e52b8653a --- /dev/null

[PATCH v7 06/24] erofs: support special inode

2019-08-13 Thread Gao Xiang
This patch adds to support special inode, such as block dev, char, socket, pipe inode. Signed-off-by: Gao Xiang --- fs/erofs/inode.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index b6ea997bc4ae

[PATCH v7 18/24] erofs: introduce pagevec for decompression subsystem

2019-08-13 Thread Gao Xiang
whole array itself up will be needed. Signed-off-by: Gao Xiang --- fs/erofs/zpvec.h | 159 +++ 1 file changed, 159 insertions(+) create mode 100644 fs/erofs/zpvec.h diff --git a/fs/erofs/zpvec.h b/fs/erofs/zpvec.h new file mode 100644 index

[PATCH v7 16/24] erofs: introduce workstation for decompression

2019-08-13 Thread Gao Xiang
future. Signed-off-by: Gao Xiang --- fs/erofs/internal.h | 80 + fs/erofs/super.c| 4 ++ fs/erofs/utils.c| 166 +++- 3 files changed, 248 insertions(+), 2 deletions(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h ind

[PATCH v7 07/24] erofs: add directory operations

2019-08-13 Thread Gao Xiang
This adds functions for directory, mainly readdir. Signed-off-by: Gao Xiang --- fs/erofs/dir.c | 147 + 1 file changed, 147 insertions(+) create mode 100644 fs/erofs/dir.c diff --git a/fs/erofs/dir.c b/fs/erofs/dir.c new file mode 100644 index

[PATCH v7 11/24] erofs: introduce xattr & posixacl support

2019-08-13 Thread Gao Xiang
lname: system.posix_acl_default struct erofs_xattr_entry: .e_name_len = 0 .e_name_index = EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT (3) Signed-off-by: Gao Xiang --- fs/erofs/Kconfig| 38 +++ fs/erofs/Makefile | 1 + fs/erofs/inode.c| 14 +- fs/erofs/internal.h | 16

[PATCH v7 04/24] erofs: add raw address_space operations

2019-08-13 Thread Gao Xiang
This commit adds functions for meta and raw data, and also provides address_space_operations for raw data access. Signed-off-by: Gao Xiang --- fs/erofs/data.c | 417 1 file changed, 417 insertions(+) create mode 100644 fs/erofs/data.c diff

[PATCH v7 13/24] erofs: add compression indexes support

2019-08-13 Thread Gao Xiang
regrab' processes if they request the same meta page. Signed-off-by: Gao Xiang --- fs/erofs/Kconfig | 9 + fs/erofs/Makefile| 1 + fs/erofs/data.c | 10 +- fs/erofs/inode.c | 2 +- fs/erofs/internal.h | 35 ++- fs/e

[PATCH v7 03/24] erofs: add super block operations

2019-08-13 Thread Gao Xiang
This commit adds erofs super block operations, including (u)mount, remount_fs, show_options, statfs, in addition to some private icache management functions. Signed-off-by: Gao Xiang --- fs/erofs/super.c | 437 +++ 1 file changed, 437 insertions

[PATCH v7 09/24] erofs: support tracepoint

2019-08-13 Thread Gao Xiang
Add basic tracepoints for ->readpage{,s}, ->lookup, ->destroy_inode, fill_inode and map_blocks. Signed-off-by: Gao Xiang --- include/trace/events/erofs.h | 241 +++ 1 file changed, 241 insertions(+) create mode 100644 include/trace/events/erofs.h dif

[PATCH v7 19/24] erofs: add erofs_allocpage()

2019-08-13 Thread Gao Xiang
This patch introduces an temporary _on-stack_ page pool to reuse the freed page directly as much as it can for better performance and release all pages at a time, it also slightly reduces the possibility of the potential memory allocation failure. Signed-off-by: Gao Xiang --- fs/erofs

[PATCH v7 21/24] erofs: introduce LZ4 decompression inplace

2019-08-13 Thread Gao Xiang
d of course (see the following patches for test results). [1] https://github.com/lz4/lz4/commit/b17f578a919b7e6b078cede2d52be29dd48c8e8c https://github.com/lz4/lz4/commit/5997e139f53169fa3a1c1b4418d2452a90b01602 Signed-off-by: Gao Xiang --- fs/erofs/decompre

[PATCH v7 15/24] erofs: introduce erofs shrinker

2019-08-13 Thread Gao Xiang
bjects. Signed-off-by: Gao Xiang --- fs/erofs/internal.h | 7 fs/erofs/super.c| 6 +++ fs/erofs/utils.c| 93 - 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 60cc77b42b19..627279

[PATCH v7 17/24] erofs: introduce per-CPU buffers implementation

2019-08-13 Thread Gao Xiang
x27;s leave it as-is for now. Signed-off-by: Gao Xiang --- fs/erofs/Kconfig| 14 ++ fs/erofs/internal.h | 21 + fs/erofs/utils.c| 12 3 files changed, 47 insertions(+) diff --git a/fs/erofs/Kconfig b/fs/erofs/Kconfig index a475fbebb831..5f8787c

[PATCH v7 12/24] erofs: introduce tagged pointer

2019-08-13 Thread Gao Xiang
://en.wikipedia.org/wiki/Tagged_pointer Signed-off-by: Gao Xiang --- fs/erofs/tagptr.h | 110 ++ 1 file changed, 110 insertions(+) create mode 100644 fs/erofs/tagptr.h diff --git a/fs/erofs/tagptr.h b/fs/erofs/tagptr.h new file mode 100644 index

[PATCH v7 01/24] erofs: add on-disk layout

2019-08-13 Thread Gao Xiang
This commit adds the on-disk layout header file of erofs. On-disk format is compatible with erofs-staging added in 4.19. In addition, add EROFS_SUPER_MAGIC_V1 to magic.h. Signed-off-by: Gao Xiang --- fs/erofs/erofs_fs.h| 316 + include/uapi/linux

[PATCH v7 23/24] erofs: introduce cached decompression

2019-08-13 Thread Gao Xiang
This patch adds strategies which can be selected by users in order to cache both incomplete ends of compressed physical clusters as a complement of in-place I/O in order to boost random read, but it costs more memory than the in-place I/O only. Signed-off-by: Gao Xiang --- fs/erofs/internal.h

[PATCH v7 14/24] erofs: introduce superblock registration

2019-08-13 Thread Gao Xiang
In order to introducing shrinker solution for erofs, let's manage all mounted erofs instances at first. Signed-off-by: Gao Xiang --- fs/erofs/Makefile | 2 +- fs/erofs/internal.h | 13 + fs/erofs/super.c| 9 + fs/erofs/utils.c

[PATCH v7 24/24] erofs: add document

2019-08-13 Thread Gao Xiang
This documents key features, usage, and on-disk design of erofs. Signed-off-by: Gao Xiang --- Documentation/filesystems/erofs.txt | 225 1 file changed, 225 insertions(+) create mode 100644 Documentation/filesystems/erofs.txt diff --git a/Documentation/filesystems

[PATCH v7 08/24] erofs: add namei functions

2019-08-13 Thread Gao Xiang
This commit adds functions that transfer names to inodes. Signed-off-by: Gao Xiang --- fs/erofs/namei.c | 247 +++ 1 file changed, 247 insertions(+) create mode 100644 fs/erofs/namei.c diff --git a/fs/erofs/namei.c b/fs/erofs/namei.c new file mode

[PATCH v7 20/24] erofs: introduce generic decompression backend

2019-08-13 Thread Gao Xiang
ch. Signed-off-by: Gao Xiang --- fs/erofs/Makefile | 2 +- fs/erofs/compress.h | 62 fs/erofs/decompressor.c | 332 3 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 fs/erofs/compress.h create mode 100644 fs/erofs

[PATCH v7 22/24] erofs: introduce the decompression frontend

2019-08-13 Thread Gao Xiang
allocation and all extra compressed data memcpy. Signed-off-by: Gao Xiang --- fs/erofs/Kconfig|1 + fs/erofs/Makefile |2 +- fs/erofs/internal.h | 14 +- fs/erofs/super.c| 11 + fs/erofs/zdata.c| 1254 +++ fs/erofs/zdata.h| 192

[PATCH v7 00/24] erofs: promote erofs from staging

2019-08-13 Thread Gao Xiang
of supported out-of-tree / orphan stuffs as well. Thank you in advance, Gao Xiang [1] https://kccncosschn19eng.sched.com/event/Nru2/erofs-an-introduction-and-our-smartphone-practice-xiang-gao-huawei [2] https://www.usenix.org/conference/atc19/presentation/gao Changelog from v6: o keep up with th

[PATCH v7 05/24] erofs: add inode operations

2019-08-13 Thread Gao Xiang
This adds core functions to get, read an inode. It adds statx support as well. Signed-off-by: Gao Xiang --- fs/erofs/inode.c | 291 +++ 1 file changed, 291 insertions(+) create mode 100644 fs/erofs/inode.c diff --git a/fs/erofs/inode.c b/fs/erofs

Re: [PATCH v7 08/24] erofs: add namei functions

2019-08-13 Thread Gao Xiang
N/EFSCORRUPTED is actually for such thing, nowadays, EROFS treats all EFSCORRUPTED cases into EIO, and I will update that in one patch... (Yes, it needs to print something of course :)) Thanks, Gao Xiang > > Pavel > -- &

Re: [PATCH v7 08/24] erofs: add namei functions

2019-08-13 Thread Gao Xiang
On Tue, Aug 13, 2019 at 08:23:32PM +0800, Gao Xiang wrote: > Hi Pavel, > > On Tue, Aug 13, 2019 at 01:48:21PM +0200, Pavel Machek wrote: [] > There is something needing to be concerned, is, whether namei() should > report any potential on-disk issues or just return -ENOENT for th

Re: [PATCH] staging: erofs: removing an extra call to iloc() in fill_inode()

2019-08-13 Thread Gao Xiang
Hi Pratik, On Wed, Aug 14, 2019 at 02:08:40AM +0530, Pratik Shinde wrote: > in fill_inode() we call iloc() twice.Avoiding the extra call by > storing the result. > > Signed-off-by: Pratik Shinde I have no objection of this patch, but I'd like to hear Chao/Greg's idea abou

Re: [PATCH] staging: erofs: removing an extra call to iloc() in fill_inode()

2019-08-13 Thread Gao Xiang
On Wed, Aug 14, 2019 at 09:56:09AM +0800, Chao Yu wrote: > On 2019/8/14 9:59, Gao Xiang wrote: > > Hi Pratik, > > > > On Wed, Aug 14, 2019 at 02:08:40AM +0530, Pratik Shinde wrote: > >> in fill_inode() we call iloc() twice.Avoiding the extra call by > >> s

[PATCH 1/2] staging: erofs: introduce EFSCORRUPTED and more logs

2019-08-13 Thread Gao Xiang
Previously, EROFS uses EIO to indicate that filesystem is corrupted as well, but other filesystems tend to use EUCLEAN instead, let's follow what others do right now. Also, add some more prints to the syslog. Suggested-by: Pavel Machek Signed-off-by: Gao Xiang --- This patchset has depen

[PATCH 2/2] staging: erofs: differentiate unsupported on-disk format

2019-08-13 Thread Gao Xiang
For some specific fields, use ENOTSUPP instead of EIO for values which look sane but aren't supported right now. Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c | 4 ++-- drivers/staging/erofs/zmap.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dr

[PATCH RESEND 1/2] staging: erofs: introduce EFSCORRUPTED and more logs

2019-08-13 Thread Gao Xiang
Previously, EROFS uses EIO to indicate that filesystem is corrupted as well, but other filesystems tend to use EUCLEAN instead, let's follow what others do right now. Also, add some more prints to the syslog. Suggested-by: Pavel Machek Signed-off-by: Gao Xiang --- [RESEND]: add Pavel t

[PATCH RESEND 2/2] staging: erofs: differentiate unsupported on-disk format

2019-08-13 Thread Gao Xiang
For some specific fields, use ENOTSUPP instead of EIO for values which look sane but aren't supported right now. Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c | 4 ++-- drivers/staging/erofs/zmap.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dr

Re: [PATCH] staging: erofs: removing an extra call to iloc() in fill_inode()

2019-08-14 Thread Gao Xiang
see the following, https://lore.kernel.org/lkml/20190805044225.ga14...@kroah.com/ Happy hacking! :) Thanks, Gao Xiang > > On Wed, Aug 14, 2019 at 7:37 AM Gao Xiang wrote: > > > On Wed, Aug 14, 2019 at 09:56:09AM +0800, Chao Yu wrote: > > > On 2019/8/14 9:59, Gao Xiang

Re: [PATCH RESEND 2/2] staging: erofs: differentiate unsupported on-disk format

2019-08-14 Thread Gao Xiang
Hi Chao, On Wed, Aug 14, 2019 at 05:25:51PM +0800, Chao Yu wrote: > On 2019/8/14 12:32, Gao Xiang wrote: > > For some specific fields, use ENOTSUPP instead of EIO > > for values which look sane but aren't supported right now. > > > > Signed-off-by: Gao

[PATCH v2 3/3] staging: erofs: correct all misused ENOTSUPP

2019-08-14 Thread Gao Xiang
As Chao pointed out [1], ENOTSUPP is used for NFS protocol only, we should use EOPNOTSUPP instead... [1] https://lore.kernel.org/lkml/108ee2f9-75dd-b8ab-8da7-b81c17baf...@huawei.com/ Reported-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/decompressor.c | 2 +- drivers

[PATCH v2 1/3] staging: erofs: introduce EFSCORRUPTED and more logs

2019-08-14 Thread Gao Xiang
14821.GB11559@amd/ Suggested-by: Pavel Machek Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- change log from v1: - update the commit message; This patchset has dependency on the previous patchset yesterday https://lore.kernel.org/lkml/20190813023054.73126-1-gaoxian...@huawei.com/ Thanks

[PATCH v2 2/3] staging: erofs: differentiate unsupported on-disk format

2019-08-14 Thread Gao Xiang
For some specific fields, use EOPNOTSUPP instead of EIO for values which look sane but aren't supported right now. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- change log from v1: - use EOPNOTSUPP rather than ENOTSUPP pointed by Chao; drivers/staging/erofs/inode.c | 4 ++-- dr

[PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-08-14 Thread Gao Xiang
lname: system.posix_acl_default struct erofs_xattr_entry: .e_name_len = 0 .e_name_index = EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT (3) Signed-off-by: Gao Xiang --- fs/erofs/Kconfig| 38 +++ fs/erofs/Makefile | 1 + fs/erofs/inode.c| 14 +- fs/erofs/internal.h | 16

<    1   2   3   4   5   6   7   8   9   >