Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-04 Thread Daeho Jeong
Yep, we need to come back to v1 and enable verity in a unit of cluster. Plus, as I told you, I'll prevent newly verity enalbed pages from being merged with verity disabled bio. Thanks, 2020년 12월 5일 (토) 오전 3:29, Jaegeuk Kim 님이 작성: > > On 12/04, Daeho Jeong wrote: > > Thanks for the explanation

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-04 Thread Jaegeuk Kim
On 12/04, Daeho Jeong wrote: > Thanks for the explanation about verity. > I got your point. Thanks~ Possible fix can be like this? --- fs/f2fs/compress.c | 2 -- fs/f2fs/data.c | 19 +-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/compress.c

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Daeho Jeong
Thanks for the explanation about verity. I got your point. Thanks~ 2020년 12월 4일 (금) 오후 2:18, Eric Biggers 님이 작성: > > On Fri, Dec 04, 2020 at 02:00:34PM +0900, Daeho Jeong wrote: > > I think I don't understand how verity works. > > Right after verity is enabled on a file, is the verity logic

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 02:00:34PM +0900, Daeho Jeong wrote: > I think I don't understand how verity works. > Right after verity is enabled on a file, is the verity logic working > for the whole file data area? > Or it's just working for the data area which is updated after verity is > enabled? >

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Daeho Jeong
I think I don't understand how verity works. Right after verity is enabled on a file, is the verity logic working for the whole file data area? Or it's just working for the data area which is updated after verity is enabled? 2020년 12월 4일 (금) 오후 1:51, Eric Biggers 님이 작성: > > On Fri, Dec 04, 2020

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 01:48:24PM +0900, Daeho Jeong wrote: > Eric, > > I have another question. > I understand enabling the verity can be possible in the middle of I/O. > Is the opposite way also possible? Actually, I couldn't find any > disabling function of it, though. > No, disabling

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Daeho Jeong
Eric, I have another question. I understand enabling the verity can be possible in the middle of I/O. Is the opposite way also possible? Actually, I couldn't find any disabling function of it, though. 2020년 12월 4일 (금) 오후 1:31, Daeho Jeong 님이 작성: > > > Are you sure? I thought that compression

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Daeho Jeong
> Are you sure? I thought that compression (and encryption) apply to the whole > file, including any Merkle tree blocks past i_size. This "dic" structure is only for "de"compression, so we don't need to worry about going beyond i_size case. > Also, even if you include the i_size check, it's

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 12:43:23PM +0900, Daeho Jeong wrote: > STEP_VERITY is enabled by f2fs_need_verity() and the function is like below. > We already know the second condition (idx < DIV_ROUND_UP...) is > satisfied when invoking f2fs_alloc_dic(). > > static inline bool f2fs_need_verity(const

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Daeho Jeong
STEP_VERITY is enabled by f2fs_need_verity() and the function is like below. We already know the second condition (idx < DIV_ROUND_UP...) is satisfied when invoking f2fs_alloc_dic(). static inline bool f2fs_need_verity(const struct inode *inode, pgoff_t idx) { return

Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression

2020-12-03 Thread Eric Biggers
On Fri, Dec 04, 2020 at 09:58:47AM +0900, Daeho Jeong wrote: > diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c > index 87090da8693d..cdf72e153da0 100644 > --- a/fs/f2fs/compress.c > +++ b/fs/f2fs/compress.c > @@ -803,8 +803,6 @@ void f2fs_decompress_pages(struct bio *bio, struct page >