[f2fs-dev] [PATCH 3/4 v2] f2fs-tools: Improve zoned model check

2019-03-27 Thread Damien Le Moal
Return an error if an unknown zoned model is reported for a device or if parsing of the device zoned model fails. Also add comments to briefly explain the zone models and what to do in the absence of a kernel reported zoned model for a device. Signed-off-by: Damien Le Moal --- include/f2fs_fs.h

[f2fs-dev] [PATCH 1/4 v2] f2fs-tools: Fix various compilation warnings

2019-03-27 Thread Damien Le Moal
Avoid various compilation warnings due to strncpy: libf2fs.c:590:33: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] snprintf(rootdev, ret, "/dev/%s", buf); ../include/f2fs_fs.h:1384:2: warning: ‘strncpy’ specified bound depends on the length

[f2fs-dev] [PATCH 4/4 v2] f2fs-tools: Fix multi-device format with zoned devices

2019-03-27 Thread Damien Le Moal
There is no need to require conventional zones for a zoned block device that is not the first device of a multi-device volume. As a result, there is no need to check the number of conventional zones of the device if the device index is not 0. Signed-off-by: Damien Le Moal ---

[f2fs-dev] [PATCH 2/4 v2] f2fs-tools: Add f2fs_io to .gitignore

2019-03-27 Thread Damien Le Moal
GIT ignore compiled executable tools/f2fs_io/f2fs_io. Signed-off-by: Damien Le Moal Reviewed-by: Chao Yu --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3f04e85..c1341da 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ stamp-h1

[f2fs-dev] [PATCH 0/4 v2] Zoned block device support improvments

2019-03-27 Thread Damien Le Moal
The first 2 patches of this series are not zoned block device specific and fix compilation warnings and modify .gitignore file to handle /tools/f2fs_io/f2fs_io. The last 2 patches are improvements of zoned block device support, with the last patch being the most important. Damien Le Moal (4):

Re: [f2fs-dev] [PATCH] fs: fix warning about Using plain integer as NULL pointer

2019-03-27 Thread Mukesh Ojha
On 3/23/2019 3:40 AM, Hariprasad Kelam wrote: Sparse warning below: sudo make C=2 CF=-D__CHECK_ENDIAN__ M=fs CHECK fs/f2fs/data.c fs/f2fs/data.c:426:47: warning: Using plain integer as NULL pointer CHECK fs/notify/fdinfo.c fs/notify/fdinfo.c:53:87: warning: Using plain integer as NULL

[f2fs-dev] [PATCH AUTOSEL 5.0 048/262] f2fs: fix to check inline_xattr_size boundary correctly

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit 500e0b28ecd3c5aade98f3c3a339d18dcb166bb6 ] We use below condition to check inline_xattr_size boundary: if (!F2FS_OPTION(sbi).inline_xattr_size || F2FS_OPTION(sbi).inline_xattr_size >= DEF_ADDRS_PER_INODE -

[f2fs-dev] [PATCH AUTOSEL 5.0 006/262] f2fs: fix to avoid deadlock in f2fs_read_inline_dir()

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit aadcef64b22f668c1a107b86d3521d9cac915c24 ] As Jiqun Li reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202883 sometimes, dead lock when make system call SYS_getdents64 with fsync() is called by another process. monkey running on android9.0

[f2fs-dev] [PATCH AUTOSEL 5.0 007/262] f2fs: fix to avoid deadlock of atomic file operations

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit 48432984d718c95cf13e26d487c2d1b697c3c01f ] Thread AThread B - __fput - f2fs_release_file - drop_inmem_pages - mutex_lock(>inmem_lock) - __revoke_inmem_pages - lock_page(page) -

[f2fs-dev] [PATCH AUTOSEL 5.0 042/262] f2fs: fix to data block override node segment by mistake

2019-03-27 Thread Sasha Levin
From: zhengliang [ Upstream commit a0770e13c8da83bdb64738c0209ab02dd3cfff8b ] v4: Rearrange the previous three versions. The following scenario could lead to data block override by mistake. TASK A| TASK kworker| TASK B

[f2fs-dev] [PATCH AUTOSEL 5.0 041/262] f2fs: do not use mutex lock in atomic context

2019-03-27 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 9083977dabf3833298ddcd40dee28687f1e6b483 ] Fix below warning coming because of using mutex lock in atomic context. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:98 in_atomic(): 1, irqs_disabled(): 0, pid: 585, name: sh

[f2fs-dev] [PATCH AUTOSEL 4.19 164/192] f2fs: UBSAN: set boolean value iostat_enable correctly

2019-03-27 Thread Sasha Levin
From: Sheng Yong [ Upstream commit ac92985864e187a1735502f6a02f54eaa655b2aa ] When setting /sys/fs/f2fs//iostat_enable with non-bool value, UBSAN reports the following warning. [ 7562.295484] [ 7562.296531]

[f2fs-dev] [PATCH AUTOSEL 4.4 13/63] f2fs: do not use mutex lock in atomic context

2019-03-27 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 9083977dabf3833298ddcd40dee28687f1e6b483 ] Fix below warning coming because of using mutex lock in atomic context. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:98 in_atomic(): 1, irqs_disabled(): 0, pid: 585, name: sh

[f2fs-dev] [PATCH AUTOSEL 5.0 005/262] f2fs: fix to adapt small inline xattr space in __find_inline_xattr()

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit 2c28aba8b2e2a51749fa66e01b68e1cd5b53e022 ] With below testcase, we will fail to find existed xattr entry: 1. mkfs.f2fs -O extra_attr -O flexible_inline_xattr /dev/zram0 2. mount -t f2fs -o inline_xattr_size=1 /dev/zram0 /mnt/f2fs/ 3. touch /mnt/f2fs/file 4.

[f2fs-dev] [PATCH AUTOSEL 5.0 223/262] f2fs: fix to initialize variable to avoid UBSAN/smatch warning

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit f9aa52a8cbe09fe25244d59c29660bbe635df613 ] As Dan Carpenter as below: The patch df634f444ee9: "f2fs: use rb_*_cached friends" from Oct 4, 2018, leads to the following static checker warning: fs/f2fs/extent_cache.c:606 f2fs_update_extent_tree_range()

[f2fs-dev] [PATCH AUTOSEL 5.0 222/262] f2fs: UBSAN: set boolean value iostat_enable correctly

2019-03-27 Thread Sasha Levin
From: Sheng Yong [ Upstream commit ac92985864e187a1735502f6a02f54eaa655b2aa ] When setting /sys/fs/f2fs//iostat_enable with non-bool value, UBSAN reports the following warning. [ 7562.295484] [ 7562.296531]

[f2fs-dev] [PATCH AUTOSEL 4.14 003/123] f2fs: fix to avoid deadlock in f2fs_read_inline_dir()

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit aadcef64b22f668c1a107b86d3521d9cac915c24 ] As Jiqun Li reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202883 sometimes, dead lock when make system call SYS_getdents64 with fsync() is called by another process. monkey running on android9.0

[f2fs-dev] [PATCH AUTOSEL 4.19 004/192] f2fs: fix to avoid deadlock in f2fs_read_inline_dir()

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit aadcef64b22f668c1a107b86d3521d9cac915c24 ] As Jiqun Li reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202883 sometimes, dead lock when make system call SYS_getdents64 with fsync() is called by another process. monkey running on android9.0

[f2fs-dev] [PATCH AUTOSEL 4.19 005/192] f2fs: fix to avoid deadlock of atomic file operations

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit 48432984d718c95cf13e26d487c2d1b697c3c01f ] Thread AThread B - __fput - f2fs_release_file - drop_inmem_pages - mutex_lock(>inmem_lock) - __revoke_inmem_pages - lock_page(page) -

[f2fs-dev] [PATCH AUTOSEL 4.19 003/192] f2fs: fix to adapt small inline xattr space in __find_inline_xattr()

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit 2c28aba8b2e2a51749fa66e01b68e1cd5b53e022 ] With below testcase, we will fail to find existed xattr entry: 1. mkfs.f2fs -O extra_attr -O flexible_inline_xattr /dev/zram0 2. mount -t f2fs -o inline_xattr_size=1 /dev/zram0 /mnt/f2fs/ 3. touch /mnt/f2fs/file 4.

[f2fs-dev] [PATCH AUTOSEL 4.19 032/192] f2fs: fix to data block override node segment by mistake

2019-03-27 Thread Sasha Levin
From: zhengliang [ Upstream commit a0770e13c8da83bdb64738c0209ab02dd3cfff8b ] v4: Rearrange the previous three versions. The following scenario could lead to data block override by mistake. TASK A| TASK kworker| TASK B

[f2fs-dev] [PATCH AUTOSEL 4.19 031/192] f2fs: do not use mutex lock in atomic context

2019-03-27 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 9083977dabf3833298ddcd40dee28687f1e6b483 ] Fix below warning coming because of using mutex lock in atomic context. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:98 in_atomic(): 1, irqs_disabled(): 0, pid: 585, name: sh

[f2fs-dev] [PATCH AUTOSEL 4.19 037/192] f2fs: fix to check inline_xattr_size boundary correctly

2019-03-27 Thread Sasha Levin
From: Chao Yu [ Upstream commit 500e0b28ecd3c5aade98f3c3a339d18dcb166bb6 ] We use below condition to check inline_xattr_size boundary: if (!F2FS_OPTION(sbi).inline_xattr_size || F2FS_OPTION(sbi).inline_xattr_size >= DEF_ADDRS_PER_INODE -

[f2fs-dev] [PATCH AUTOSEL 4.14 022/123] f2fs: fix to data block override node segment by mistake

2019-03-27 Thread Sasha Levin
From: zhengliang [ Upstream commit a0770e13c8da83bdb64738c0209ab02dd3cfff8b ] v4: Rearrange the previous three versions. The following scenario could lead to data block override by mistake. TASK A| TASK kworker| TASK B

[f2fs-dev] [PATCH AUTOSEL 4.14 021/123] f2fs: do not use mutex lock in atomic context

2019-03-27 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 9083977dabf3833298ddcd40dee28687f1e6b483 ] Fix below warning coming because of using mutex lock in atomic context. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:98 in_atomic(): 1, irqs_disabled(): 0, pid: 585, name: sh

[f2fs-dev] [PATCH AUTOSEL 4.9 15/87] f2fs: do not use mutex lock in atomic context

2019-03-27 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 9083977dabf3833298ddcd40dee28687f1e6b483 ] Fix below warning coming because of using mutex lock in atomic context. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:98 in_atomic(): 1, irqs_disabled(): 0, pid: 585, name: sh

[f2fs-dev] BUG: kernel stack overflow when mounting with data_flush

2019-03-27 Thread Hagbard Celine
Hi, this is a long standing bug that I've hit before on older kernels, but I was not able to get the syslog saved because of the nature of the bug. This time I had booted form a pen-drive, and was able to save the log to it's efi-partition. What i did to trigger it was to create a partition and