From: Eric Biggers <ebiggers@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>
Cc: Daeho Jeong <daehojeong@google.com>,
kernel-team@android.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression
Date: Thu, 3 Dec 2020 19:28:11 -0800 [thread overview]
Message-ID: <X8msy1T8uqZ4Z/iR@sol.localdomain> (raw)
In-Reply-To: <20201204005847.654074-1-daeho43@gmail.com>
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 *page, bool verity)
> if (cops->destroy_decompress_ctx)
> cops->destroy_decompress_ctx(dic);
> out_free_dic:
> - if (verity)
> - atomic_set(&dic->pending_pages, dic->nr_cpages);
> if (!verity)
> f2fs_decompress_end_io(dic->rpages, dic->cluster_size,
> ret, false);
> @@ -1498,6 +1496,8 @@ struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc)
> dic->magic = F2FS_COMPRESSED_PAGE_MAGIC;
> dic->inode = cc->inode;
> atomic_set(&dic->pending_pages, cc->nr_cpages);
> + if (fsverity_active(cc->inode))
> + atomic_set(&dic->verity_pages, cc->nr_cpages);
> dic->cluster_idx = cc->cluster_idx;
> dic->cluster_size = cc->cluster_size;
> dic->log_cluster_size = cc->log_cluster_size;
The check for fsverity_active() is wrong. It looks like you need to know
whether the bio needs to go through the fs-verity data verification. The
correct way to determine that is to check whether STEP_VERITY is enabled in the
bio's bio_post_read_ctx. It's set by f2fs_grab_read_bio() when needed.
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-12-04 3:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 0:58 [f2fs-dev] [PATCH] f2fs: fix race of pending_pages in decompression Daeho Jeong
2020-12-04 3:28 ` Eric Biggers [this message]
2020-12-04 3:43 ` Daeho Jeong
2020-12-04 4:01 ` Eric Biggers
2020-12-04 4:31 ` Daeho Jeong
2020-12-04 4:48 ` Daeho Jeong
2020-12-04 4:51 ` Eric Biggers
2020-12-04 5:00 ` Daeho Jeong
2020-12-04 5:18 ` Eric Biggers
2020-12-04 7:01 ` Daeho Jeong
2020-12-04 18:29 ` Jaegeuk Kim
2020-12-05 3:40 ` Daeho Jeong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X8msy1T8uqZ4Z/iR@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).