Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell via Linux-f2fs-devel
> On Sep 17, 2020, at 6:47 PM, Chao Yu wrote: > > On 2020/9/18 3:34, Nick Terrell wrote: >>> On Sep 17, 2020, at 11:00 AM, Nick Terrell wrote: >>> >>> >>> On Sep 16, 2020, at 11:31 PM, Chao Yu wrote: Hi Nick, On 2020/9/17 2:39, Nick Terrell wrote: >> On Sep 1

[f2fs-dev] [PATCH] f2fs: compress: fix to disallow enabling compress on non-empty file

2020-09-17 Thread Chao Yu
Compressed inode and normal inode has different layout, so we should disallow enabling compress on non-empty file to avoid race condition during inode .i_addr array parsing and updating. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/file.

Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Chao Yu
On 2020/9/18 10:56, Eric Biggers wrote: On Fri, Sep 18, 2020 at 09:47:32AM +0800, Chao Yu wrote: Ah, I got it. Step of enabling compressed inode is not correct, we should touch an empty file, and then use 'chattr +c' on that file to enable compression, otherwise the race condition could be comp

Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Eric Biggers
On Fri, Sep 18, 2020 at 09:47:32AM +0800, Chao Yu wrote: > Ah, I got it. > > Step of enabling compressed inode is not correct, we should touch an empty > file, and then use 'chattr +c' on that file to enable compression, otherwise > the race condition could be complicated to handle. So we need bel

[f2fs-dev] [PATCH AUTOSEL 5.4 064/330] f2fs: stop GC when the victim becomes fully valid

2020-09-17 Thread Sasha Levin
From: Jaegeuk Kim [ Upstream commit 803e74be04b32f7785742dcabfc62116718fbb06 ] We must stop GC, once the segment becomes fully valid. Otherwise, it can produce another dirty segments by moving valid blocks in the segment partially. Ramon hit no free segment panic sometimes and saw this case hap

[f2fs-dev] [PATCH AUTOSEL 5.4 034/330] f2fs: avoid kernel panic on corruption test

2020-09-17 Thread Sasha Levin
From: Jaegeuk Kim [ Upstream commit bc005a4d5347da68e690f78d365d8927c87dc85a ] xfstests/generic/475 complains kernel warn/panic while testing corrupted disk. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/node.c | 1 - 1 file changed, 1 deletion(-) d

Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Chao Yu
On 2020/9/18 3:34, Nick Terrell wrote: On Sep 17, 2020, at 11:00 AM, Nick Terrell wrote: On Sep 16, 2020, at 11:31 PM, Chao Yu wrote: Hi Nick, On 2020/9/17 2:39, Nick Terrell wrote: On Sep 15, 2020, at 11:31 PM, Chao Yu wrote: Hi Nick, remove not related mailing list. On 2020/9/16

Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Chao Yu
On 2020/9/18 2:00, Nick Terrell wrote: On Sep 16, 2020, at 11:31 PM, Chao Yu wrote: Hi Nick, On 2020/9/17 2:39, Nick Terrell wrote: On Sep 15, 2020, at 11:31 PM, Chao Yu wrote: Hi Nick, remove not related mailing list. On 2020/9/16 11:43, Nick Terrell wrote: From: Nick Terrell Move a

[f2fs-dev] [PATCH] f2fs: remove duplicated code in sanity_check_area_boundary

2020-09-17 Thread Wang Xiaojun
Use seg_end_blkaddr instead of "segment0_blkaddr + (segment_count << log_blocks_per_seg)". Signed-off-by: Wang Xiaojun --- fs/f2fs/super.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dfa072fa8081..d9ec59d68f63 100644 --

Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell via Linux-f2fs-devel
> On Sep 17, 2020, at 11:00 AM, Nick Terrell wrote: > > > >> On Sep 16, 2020, at 11:31 PM, Chao Yu wrote: >> >> Hi Nick, >> >> On 2020/9/17 2:39, Nick Terrell wrote: On Sep 15, 2020, at 11:31 PM, Chao Yu wrote: Hi Nick, remove not related mailing list. >>>

Re: [f2fs-dev] [PATCH 6/9] f2fs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell via Linux-f2fs-devel
> On Sep 16, 2020, at 11:31 PM, Chao Yu wrote: > > Hi Nick, > > On 2020/9/17 2:39, Nick Terrell wrote: >>> On Sep 15, 2020, at 11:31 PM, Chao Yu wrote: >>> >>> Hi Nick, >>> >>> remove not related mailing list. >>> >>> On 2020/9/16 11:43, Nick Terrell wrote: From: Nick Terrell Mo

Re: [f2fs-dev] [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell via Linux-f2fs-devel
> On Sep 17, 2020, at 7:28 AM, Chris Mason wrote: > > On 17 Sep 2020, at 6:04, Christoph Hellwig wrote: > >> On Wed, Sep 16, 2020 at 09:35:51PM -0400, Rik van Riel wrote: One possibility is to have a kernel wrapper on top of the zstd API to make it more ergonomic. I personally d

Re: [f2fs-dev] [PATCH 1/9] lib: zstd: Add zstd compatibility wrapper

2020-09-17 Thread Nick Terrell via Linux-f2fs-devel
> On Sep 16, 2020, at 1:48 AM, Christoph Hellwig wrote: > > On Tue, Sep 15, 2020 at 08:42:54PM -0700, Nick Terrell wrote: >> From: Nick Terrell >> >> Adds zstd_compat.h which provides the necessary functions from the >> current zstd.h API. It is only active for zstd versions 1.4.6 and newer.

Re: [f2fs-dev] [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *'

2020-09-17 Thread Jeff Layton
On Thu, 2020-09-17 at 08:29 -0700, Eric Biggers wrote: > On Thu, Sep 17, 2020 at 08:32:39AM -0400, Jeff Layton wrote: > > On Wed, 2020-09-16 at 21:11 -0700, Eric Biggers wrote: > > > From: Eric Biggers > > > > > > fscrypt_set_test_dummy_encryption() requires that the optional argument > > > to th

Re: [f2fs-dev] [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *'

2020-09-17 Thread Eric Biggers
On Thu, Sep 17, 2020 at 08:32:39AM -0400, Jeff Layton wrote: > On Wed, 2020-09-16 at 21:11 -0700, Eric Biggers wrote: > > From: Eric Biggers > > > > fscrypt_set_test_dummy_encryption() requires that the optional argument > > to the test_dummy_encryption mount option be specified as a substring_t.

Re: [f2fs-dev] [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Chris Mason via Linux-f2fs-devel
On 17 Sep 2020, at 6:04, Christoph Hellwig wrote: On Wed, Sep 16, 2020 at 09:35:51PM -0400, Rik van Riel wrote: One possibility is to have a kernel wrapper on top of the zstd API to make it more ergonomic. I personally don???t really see the value in it, since it adds another layer of indire

Re: [f2fs-dev] [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell via Linux-f2fs-devel
> On Sep 16, 2020, at 7:46 AM, Christoph Hellwig wrote: > > On Wed, Sep 16, 2020 at 10:43:04AM -0400, Chris Mason wrote: >> Otherwise we just end up with drift and kernel-specific bugs that are harder >> to debug. To the extent those APIs make us contort the kernel code, I???m >> sure Nick is

Re: [f2fs-dev] [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *'

2020-09-17 Thread Jeff Layton
On Wed, 2020-09-16 at 21:11 -0700, Eric Biggers wrote: > From: Eric Biggers > > fscrypt_set_test_dummy_encryption() requires that the optional argument > to the test_dummy_encryption mount option be specified as a substring_t. > That doesn't work well with filesystems that use the new mount API,

[f2fs-dev] [PATCH v2] f2fs: fix wrong total_sections check and fsmeta check

2020-09-17 Thread Wang Xiaojun
Meta area is not included in section_count computation. So the minimum number of total_sections is 1 meanwhile it cannot be greater than segment_count_main. The minimum number of meta segments is 8 (SB + 2 (CP + SIT + NAT) + SSA). Signed-off-by: Wang Xiaojun --- fs/f2fs/segment.h | 1 + fs/f2fs

Re: [f2fs-dev] [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Christoph Hellwig
On Wed, Sep 16, 2020 at 09:35:51PM -0400, Rik van Riel wrote: > > One possibility is to have a kernel wrapper on top of the zstd API to > > make it > > more ergonomic. I personally don???t really see the value in it, since > > it adds > > another layer of indirection between zstd and the caller, bu

Re: [f2fs-dev] [PATCH] f2fs: change return value of reserved_segments to unsigned int

2020-09-17 Thread Chao Yu
On 2020/9/16 16:00, Xiaojun Wang wrote: The type of SM_I(sbi)->reserved_segments is unsigned int, so change the return value to unsigned int. The type cast can be removed in reserved_sections as a result. Signed-off-by: Xiaojun Wang Reviewed-by: Chao Yu Thanks, ___