[f2fs-dev] [PATCH AUTOSEL 4.4 28/35] f2fs: avoid out-of-range memory access

2019-07-18 Thread Sasha Levin
From: Ocean Chen [ Upstream commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a ] blkoff_off might over 512 due to fs corrupt or security vulnerability. That should be checked before being using. Use ENTRIES_IN_SUM to protect invalid value in cur_data_blkoff. Signed-off-by: Ocean Chen

[f2fs-dev] [PATCH AUTOSEL 4.9 38/45] f2fs: avoid out-of-range memory access

2019-07-18 Thread Sasha Levin
From: Ocean Chen [ Upstream commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a ] blkoff_off might over 512 due to fs corrupt or security vulnerability. That should be checked before being using. Use ENTRIES_IN_SUM to protect invalid value in cur_data_blkoff. Signed-off-by: Ocean Chen

[f2fs-dev] [PATCH AUTOSEL 4.14 49/60] f2fs: avoid out-of-range memory access

2019-07-18 Thread Sasha Levin
From: Ocean Chen [ Upstream commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a ] blkoff_off might over 512 due to fs corrupt or security vulnerability. That should be checked before being using. Use ENTRIES_IN_SUM to protect invalid value in cur_data_blkoff. Signed-off-by: Ocean Chen

[f2fs-dev] [PATCH AUTOSEL 4.19 081/101] f2fs: avoid out-of-range memory access

2019-07-18 Thread Sasha Levin
From: Ocean Chen [ Upstream commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a ] blkoff_off might over 512 due to fs corrupt or security vulnerability. That should be checked before being using. Use ENTRIES_IN_SUM to protect invalid value in cur_data_blkoff. Signed-off-by: Ocean Chen

[f2fs-dev] [PATCH AUTOSEL 5.1 115/141] f2fs: fix to avoid long latency during umount

2019-07-18 Thread Sasha Levin
From: Heng Xiao [ Upstream commit 6e0cd4a9dd4df1a0afcb454f1e654b5c80685913 ] In umount, we give an constand time to handle pending discard, previously, in __issue_discard_cmd() we missed to check timeout condition in loop, result in delaying long time, fix it. Signed-off-by: Heng Xiao [Chao

[f2fs-dev] [PATCH AUTOSEL 5.1 116/141] f2fs: avoid out-of-range memory access

2019-07-18 Thread Sasha Levin
From: Ocean Chen [ Upstream commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a ] blkoff_off might over 512 due to fs corrupt or security vulnerability. That should be checked before being using. Use ENTRIES_IN_SUM to protect invalid value in cur_data_blkoff. Signed-off-by: Ocean Chen

[f2fs-dev] [PATCH AUTOSEL 5.1 080/141] f2fs: fix is_idle() check for discard type

2019-07-18 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 56659ce838456c6f2315ce8a4bd686ac4b23e9d1 ] The discard thread should issue upto dpolicy->max_requests at once and wait for all those discard requests at once it reaches dpolicy->max_requests. It should then sleep for dpolicy->min_interval timeout before

[f2fs-dev] [PATCH AUTOSEL 5.1 016/141] f2fs: fix to avoid deadloop if data_flush is on

2019-07-18 Thread Sasha Levin
From: Chao Yu [ Upstream commit 040d2bb318d1aea4f28cc22504b44e44c86e ] As Hagbard Celine reported: [ 615.697824] INFO: task kworker/u16:5:344 blocked for more than 120 seconds. [ 615.697825] Not tainted 5.0.15-gentoo-f2fslog #4 [ 615.697826] "echo 0 >

[f2fs-dev] [PATCH AUTOSEL 5.1 029/141] f2fs: Lower threshold for disable_cp_again

2019-07-18 Thread Sasha Levin
From: Daniel Rosenberg [ Upstream commit ae4ad7ea09d32ff1b6fb908ff12f8c1bd5241b29 ] The existing threshold for allowable holes at checkpoint=disable time is too high. The OVP space contains reserved segments, which are always in the form of free segments. These must be subtracted from the OVP

[f2fs-dev] [PATCH AUTOSEL 5.1 028/141] f2fs: Fix accounting for unusable blocks

2019-07-18 Thread Sasha Levin
From: Daniel Rosenberg [ Upstream commit a4c3ecaaadac5693f555cfef1c9eecf4c39df818 ] Fixes possible underflows when dealing with unusable blocks. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/f2fs.h | 15

[f2fs-dev] [PATCH AUTOSEL 5.2 144/171] f2fs: fix to avoid long latency during umount

2019-07-18 Thread Sasha Levin
From: Heng Xiao [ Upstream commit 6e0cd4a9dd4df1a0afcb454f1e654b5c80685913 ] In umount, we give an constand time to handle pending discard, previously, in __issue_discard_cmd() we missed to check timeout condition in loop, result in delaying long time, fix it. Signed-off-by: Heng Xiao [Chao

[f2fs-dev] [PATCH AUTOSEL 5.2 145/171] f2fs: avoid out-of-range memory access

2019-07-18 Thread Sasha Levin
From: Ocean Chen [ Upstream commit 56f3ce675103e3fb9e631cfb4131fc768bc23e9a ] blkoff_off might over 512 due to fs corrupt or security vulnerability. That should be checked before being using. Use ENTRIES_IN_SUM to protect invalid value in cur_data_blkoff. Signed-off-by: Ocean Chen

[f2fs-dev] [PATCH AUTOSEL 5.2 104/171] f2fs: fix is_idle() check for discard type

2019-07-18 Thread Sasha Levin
From: Sahitya Tummala [ Upstream commit 56659ce838456c6f2315ce8a4bd686ac4b23e9d1 ] The discard thread should issue upto dpolicy->max_requests at once and wait for all those discard requests at once it reaches dpolicy->max_requests. It should then sleep for dpolicy->min_interval timeout before

[f2fs-dev] [PATCH AUTOSEL 5.2 039/171] f2fs: Lower threshold for disable_cp_again

2019-07-18 Thread Sasha Levin
From: Daniel Rosenberg [ Upstream commit ae4ad7ea09d32ff1b6fb908ff12f8c1bd5241b29 ] The existing threshold for allowable holes at checkpoint=disable time is too high. The OVP space contains reserved segments, which are always in the form of free segments. These must be subtracted from the OVP

[f2fs-dev] [PATCH AUTOSEL 5.2 038/171] f2fs: Fix accounting for unusable blocks

2019-07-18 Thread Sasha Levin
From: Daniel Rosenberg [ Upstream commit a4c3ecaaadac5693f555cfef1c9eecf4c39df818 ] Fixes possible underflows when dealing with unusable blocks. Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/f2fs.h | 15

[f2fs-dev] [PATCH AUTOSEL 5.2 015/171] f2fs: fix to check layout on last valid checkpoint park

2019-07-18 Thread Sasha Levin
From: Chao Yu [ Upstream commit 5dae2d39074dde941cc3150dcbb7840d88179743 ] As Ju Hyung reported: " I was semi-forced today to use the new kernel and test f2fs. My Ubuntu initramfs got a bit wonky and I had to boot into live CD and fix some stuffs. The live CD was using 4.15 kernel, and just

[f2fs-dev] [PATCH AUTOSEL 5.2 024/171] f2fs: fix to avoid deadloop if data_flush is on

2019-07-18 Thread Sasha Levin
From: Chao Yu [ Upstream commit 040d2bb318d1aea4f28cc22504b44e44c86e ] As Hagbard Celine reported: [ 615.697824] INFO: task kworker/u16:5:344 blocked for more than 120 seconds. [ 615.697825] Not tainted 5.0.15-gentoo-f2fslog #4 [ 615.697826] "echo 0 >

[PATCH] f2fs: fix to avoid tagging SBI_QUOTA_NEED_REPAIR incorrectly

2019-07-18 Thread Chao Yu
On a quota disabled image, with fault injection, SBI_QUOTA_NEED_REPAIR will be set incorrectly in error path of f2fs_evict_inode(), fix it. Signed-off-by: Chao Yu --- fs/f2fs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: Support case-insensitive file name lookups

2019-07-18 Thread Chao Yu
On 2019/7/19 8:03, Daniel Rosenberg wrote: > Modeled after commit b886ee3e778e ("ext4: Support case-insensitive file > name lookups") > > """ > This patch implements the actual support for case-insensitive file name > lookups in f2fs, based on the feature bit and the encoding stored in the >

Re: [f2fs-dev] [PATCH v3 1/2] f2fs: include charset encoding information in the superblock

2019-07-18 Thread Chao Yu
On 2019/7/19 8:03, Daniel Rosenberg wrote: > Add charset encoding to f2fs to support casefolding. It is modeled after > the same feature introduced in commit c83ad55eaa91 ("ext4: include charset > encoding information in the superblock") > > Currently this is not compatible with encryption,

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: Support case-insensitive file name lookups

2019-07-18 Thread Chao Yu
On 2019/7/19 5:31, Daniel Rosenberg wrote: > > On 7/17/19 3:11 AM, Chao Yu wrote: >> We need to add one more entry f2fs_fsflags_map[] to map F2FS_CASEFOLD_FL to >> FS_CASEFOLD_FL correctly and adapt F2FS_GETTABLE_FS_FL/F2FS_SETTABLE_FS_FL >> as well. > > I don't see FS_CASEFOLD_FL. It would

[f2fs-dev] [PATCH v3 0/2] Casefolding in F2FS

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are largely based on the casefolding patches for ext4 v3: Addressed feedback, apart from F2FS_CASEFOLD_FL/FS_CASEFOLD_FL Added sysfs file "encoding" to see the encoding set on a filesystem v2: Rebased patches again master, changed f2fs_msg to f2fs_info/f2fs_err Daniel Rosenberg

[f2fs-dev] [PATCH v3 2/2] f2fs: Support case-insensitive file name lookups

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
Modeled after commit b886ee3e778e ("ext4: Support case-insensitive file name lookups") """ This patch implements the actual support for case-insensitive file name lookups in f2fs, based on the feature bit and the encoding stored in the superblock. A filesystem that has the casefold feature set

[f2fs-dev] [PATCH v3 1/2] f2fs: include charset encoding information in the superblock

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
Add charset encoding to f2fs to support casefolding. It is modeled after the same feature introduced in commit c83ad55eaa91 ("ext4: include charset encoding information in the superblock") Currently this is not compatible with encryption, similar to the current ext4 imlpementation. This will

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: Support case-insensitive file name lookups

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
On 7/17/19 3:11 AM, Chao Yu wrote: We need to add one more entry f2fs_fsflags_map[] to map F2FS_CASEFOLD_FL to FS_CASEFOLD_FL correctly and adapt F2FS_GETTABLE_FS_FL/F2FS_SETTABLE_FS_FL as well. I don't see FS_CASEFOLD_FL. It would make sense for it to exist, but unless it's in some recent

[PATCH] f2fs: separate NOCoW and pinfile semantics

2019-07-18 Thread Chao Yu
Pinning a file is heavy, because skipping pinned files make GC running with heavy load or no effect. So that this patch propose to separate nocow and pinfile semantics: - NOCoW flag can only be set on regular file. - NOCoW file will only trigger IPU at common writeback/flush. - NOCow file will do

[f2fs-dev] [PATCH] common/rc: set max label length for f2fs

2019-07-18 Thread Chao Yu
f2fs can support FS_IOC_{GET,SET}FSLABEL now, set max label length to enable generic/492 testcase for f2fs. Signed-off-by: Chao Yu --- common/rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/rc b/common/rc index 75ca6324..45781619 100644 --- a/common/rc +++ b/common/rc @@

[f2fs-dev] [Bug 204193] BUG: KASAN: null-ptr-deref in f2fs_write_end_io+0x215/0x650

2019-07-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204193 Chao Yu (c...@kernel.org) changed: What|Removed |Added Status|NEW |ASSIGNED --- Comment #3 from

[f2fs-dev] [PATCH] f2fs: fix to drop meta/node pages during umount

2019-07-18 Thread Chao Yu
As reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204193 A null pointer dereference bug is triggered in f2fs under kernel-5.1.3. kasan_report.cold+0x5/0x32 f2fs_write_end_io+0x215/0x650 bio_endio+0x26e/0x320 blk_update_request+0x209/0x5d0 blk_mq_end_request+0x2e/0x230

Re: [f2fs-dev] [PATCH v2] f2fs: fix to read source block before invalidating it

2019-07-18 Thread Chao Yu
On 2019/7/18 12:00, Jaegeuk Kim wrote: > On 07/18, Chao Yu wrote: >> On 2019/7/18 11:12, Jaegeuk Kim wrote: >>> f2fs_allocate_data_block() invalidates old block address and enable new >>> block >>> address. Then, if we try to read old block by f2fs_submit_page_bio(), it >>> will >>> give WARN