[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

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

[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

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

[PATCH AUTOSEL 5.2 041/123] Staging: fbtft: Fix GPIO handling

2019-08-13 Thread Sasha Levin
From: Jan Sebastian Götte [ Upstream commit 92e3e884887c0d278042fbbb6f6c9b41d6addb71 ] Commit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards. I have tested this

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 > >> storing the result. > >> > >>

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

2019-08-13 Thread Chao Yu
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 >> storing the result. >> >> Signed-off-by: Pratik Shinde > > I have no objection of this patch, but I'd like to

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 about this... Thanks, Gao

[PATCH v2] PCI: PM: Move to D0 before calling pci_legacy_resume_early()

2019-08-13 Thread Dexuan Cui
In pci_legacy_suspend_late(), the device state is moved to PCI_UNKNOWN. In pci_pm_thaw_noirq(), the state is supposed to be moved back to PCI_D0, but the current code misses the pci_legacy_resume_early() path, so the state remains in PCI_UNKNOWN in that path. As a result, in the resume phase of

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

2019-08-13 Thread Pratik Shinde
in fill_inode() we call iloc() twice.Avoiding the extra call by storing the result. Signed-off-by: Pratik Shinde --- drivers/staging/erofs/inode.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index

[PATCH v2] staging: iio: accel: adis16240: Improve readability on write_raw function

2019-08-13 Thread Rodrigo Ribeiro
Replace shift and minus operation by GENMASK macro and remove the local variables used to store intermediate data. Signed-off-by: Rodrigo Ribeiro Carvalho --- v2: - Leave switch statement instead of replace by if statement drivers/staging/iio/accel/adis16240.c | 5 + 1 file changed, 1

Re: [PATCH v2 4/6] dt: bindings: add mt7621-pll dt binding documentation

2019-08-13 Thread Rob Herring
On Wed, Jul 24, 2019 at 10:23:08AM +0800, Chuanhong Guo wrote: > This commit adds device tree binding documentation for MT7621 > PLL controller. > > Signed-off-by: Chuanhong Guo > --- > > Change since v1: > drop useless syscon in compatible string > >

[PATCH] staging: rtl8723bs: remove redundant assignment to ret

2019-08-13 Thread Colin King
From: Colin Ian King Variable ret is initialized to a value that is never read and it is re-assigned later. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/staging/rtl8723bs/core/rtw_io.c | 2 +- 1 file

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 these > corrupted

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

2019-08-13 Thread Gao Xiang
Hi Pavel, On Tue, Aug 13, 2019 at 01:48:21PM +0200, Pavel Machek wrote: > Hi! > > > + /* > > +* on-disk error, let's only BUG_ON in the debugging mode. > > +* otherwise, it will return 1 to just skip the invalid name > > +* and go on (in consideration of the lookup performance). >

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

2019-08-13 Thread Pavel Machek
Hi! > + /* > + * on-disk error, let's only BUG_ON in the debugging mode. > + * otherwise, it will return 1 to just skip the invalid name > + * and go on (in consideration of the lookup performance). > + */ > + DBG_BUGON(qd->name > qd->end); I believe you should check

[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

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

2019-08-13 Thread Gao Xiang
This patch adds decompression backend to EROFS, which supports uncompressed and LZ4 compressed data. For compressed data, it uses the following strategy: 1) If outputsize is very small (totally less than a threshold), decompress to the per-CPU buffer and do memcpy directly in order to avoid

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

2019-08-13 Thread Gao Xiang
This patch introduces the basic inplace fixed-sized output decompression implementation for erofs filesystem. In constant to fixed-sized input compression, it has fixed-sized capacity for each compressed cluster to contain compressed data with the following advantages: 1) improved storage

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

2019-08-13 Thread Gao Xiang
Hi folks, [I strip the previous cover letter, the old one can be found in v6: https://lore.kernel.org/linux-fsdevel/20190802125347.166018-1-gaoxian...@huawei.com/] We'd like to submit a formal moving patch applied to staging tree for 5.4, before that we'd like to hear if there are some ACKs,

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

[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

[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 12/24] erofs: introduce tagged pointer

2019-08-13 Thread Gao Xiang
Currently kernel has scattered tagged pointer usages hacked by hand in plain code, without a unique and portable functionset to highlight the tagged pointer itself and wrap these hacked code in order to clean up all over meaningless magic masks. This patch introduces simple generic methods to

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

[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 13/24] erofs: add compression indexes support

2019-08-13 Thread Gao Xiang
This patch adds EROFS compression indexes support, including legacy and compacted 2/4B indexes. In addition, it introduces an iterable L2P mapping operation called 'z_erofs_map_blocks_iter'. Compared with 'erofs_map_blocks', it avoids a number of redundant 'release and regrab' processes if they

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

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

2019-08-13 Thread Gao Xiang
compressed data will be usually loaded into last pages of the extent (the last page for 4k) for in-place decompression (more specifically, in-place IO), as ilustration below, start of compressed logical extent | end of this logical extent |

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

2019-08-13 Thread Gao Xiang
This patch adds a dedicated shrinker targeting to free unneeded memory consumed by a number of erofs in-memory data structures. Like F2FS and UBIFS, it also adds: - sbi->umount_mutex to avoid races on shrinker and put_super; - sbi->shrinker_run_no to not revisit recently scanned objects.

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

2019-08-13 Thread Gao Xiang
This patch introduces per-CPU buffers in order for the upcoming generic decompression framework to use. Note that I tried to use in-kernel per-CPU buffer or per-CPU page approaches to clean up further, however noticeable performanace regression (about 2% for sequential read) was observed. Let's

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

[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
This implements xattr and posixacl functionalities. 1) Inline and shared xattrs are introduced for flexibility. Specifically, if the same xattr is used for a large number of inodes or the size of a xattr is so large that unsuitable to inline, a shared xattr will be used instead in xattr

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

2019-08-13 Thread Gao Xiang
For each physical cluster, there is a straight-forward way of allocating a fixed or variable-sized array to record the corresponding file pages for its decompression if we decide to decompress these pages asynchronously (eg. read-ahead case), however it will take variable-sized on-heap memory

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

2019-08-13 Thread Gao Xiang
This patch introduces another concept used by decompress subsystem called 'workstation'. It can be seen as a sparse array that stores pointers pointed to data structures related to the corresponding physical clusters. All lookups are protected by RCU read lock. Besides, reference count and

[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

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

2019-08-13 Thread Gao Xiang
- erofs_sb_info: contains erofs-specific in-memory information. - erofs_vnode: contains vfs_inode and other fs-specific information. same as super block, the only one in-memory definition exists. - erofs_map_blocks Logical to physical block mapping, used by erofs_map_blocks().

[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] Staging: rtl8712: rtl8712_recv: fixed 80 character length warning

2019-08-13 Thread Merwin Trever Ferrao
When the checkpatch.pl script was run, it showed lines with length more than 80 characters in rtl8712_recv.c file. Fixed by breaking it up into two lines within 80 characters. Signed-off-by: Merwin Trever Ferrao --- drivers/staging/rtl8712/rtl8712_recv.c | 3 ++- 1 file changed, 2

Re: [bug report] staging: wilc1000: added support to dynamically add/remove interfaces

2019-08-13 Thread Ajay.Kathat
Hi Dan, On 8/8/2019 4:18 PM, Dan Carpenter wrote: > > Hello Ajay Singh, > > The patch 9bc061e88054: "staging: wilc1000: added support to > dynamically add/remove interfaces" from Jun 26, 2019, leads to the > following static checker warning: > > drivers/staging/wilc1000/wilc_wlan.c:497

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

2019-08-13 Thread Chao Yu
Hi Xiang, On 2019/8/13 11:57, Gao Xiang wrote: > 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