From: Chao Yu <chao@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks
Date: Sun, 30 Aug 2020 11:23:49 +0800 [thread overview]
Message-ID: <61996dcd-6db1-13fc-8239-7e684f3ec49e@kernel.org> (raw)
In-Reply-To: <20200828054629.583577-1-daeho43@gmail.com>
On 2020-8-28 13:46, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> After releasing cblocks, the compressed file can be accidentally
> disabled in compression mode, since it has zero cblocks. As we are
> using IMMUTABLE flag to present released cblocks state, we can add
> IMMUTABLE state check when considering the compressed file disabling.
>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> ---
> fs/f2fs/f2fs.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 02811ce15059..14d30740ba03 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -3936,6 +3936,8 @@ static inline u64 f2fs_disable_compressed_file(struct inode *inode)
> if (!f2fs_compressed_file(inode))
> return 0;
> if (S_ISREG(inode->i_mode)) {
> + if (IS_IMMUTABLE(inode))
> + return 1;
It looks most of callers are from ioctl, should we add immutable check in f2fs
ioctl interfaces if necessary? or I missed existed check.
Thanks,
> if (get_dirty_pages(inode))
> return 1;
> if (fi->i_compr_blocks)
>
next prev parent reply other threads:[~2020-08-30 3:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-28 5:46 Daeho Jeong
2020-08-30 3:23 ` Chao Yu [this message]
2020-08-30 23:42 ` [f2fs-dev] " Daeho Jeong
2020-08-31 1:24 ` Chao Yu
2020-08-31 1:44 ` Daeho Jeong
2020-08-31 2:31 ` Chao Yu
2020-08-31 3:55 ` Daeho Jeong
2020-08-31 6:06 ` Chao Yu
2020-08-31 6:15 ` Daeho Jeong
2020-08-31 6:22 ` Chao Yu
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=61996dcd-6db1-13fc-8239-7e684f3ec49e@kernel.org \
--to=chao@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
Powered by JetHome