[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <X8m0qbd7rvQyiwOt@sol.localdomain>
Date: Thu, 3 Dec 2020 20:01:45 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: Daeho Jeong <daeho43@...il.com>
Cc: linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net, kernel-team@...roid.com,
Daeho Jeong <daehojeong@...gle.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in
decompression
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 struct inode *inode, pgoff_t idx)
> {
> return fsverity_active(inode) &&
> idx < DIV_ROUND_UP(inode->i_size, PAGE_SIZE);
> }
Are you sure? I thought that compression (and encryption) apply to the whole
file, including any Merkle tree blocks past i_size.
Also, even if you include the i_size check, it's still wrong to check
fsverity_active() in the middle of the I/O because FS_IOC_ENABLE_VERITY can
execute concurrently, causing fsverity_active() to return false at the beginning
of the I/O and true later in the I/O. It needs to be checked only once, at the
beginning...
- Eric
Powered by blists - more mailing lists