From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
Daeho Jeong <daehojeong@google.com>, Qi Han <hanqi@vivo.com>,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED
Date: Fri, 28 Apr 2023 09:03:45 +0800 [thread overview]
Message-ID: <20801e51-623c-d2bb-6159-9d6aebc66ca9@kernel.org> (raw)
In-Reply-To: <ZEqhImQzKJJSNLNZ@google.com>
On 2023/4/28 0:21, Jaegeuk Kim wrote:
> On 04/27, Chao Yu wrote:
>> On 2023/4/26 0:47, Yangtao Li wrote:
>>> If a file has FI_COMPRESS_RELEASED, all writes for it should not be
>>> allowed.
>>>
>>> Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE")
>>> Signed-off-by: Qi Han <hanqi@vivo.com>
>>> Signed-off-by: Yangtao Li <frank.li@vivo.com>
>>
>> Oh, I just see v2.
>>
>> Reviewed-by: Chao Yu <chao@kernel.org>
>
> Applied with using goto for code consistency.
It makes sense,
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
>
> + if (is_inode_flag_set(inode, FI_COMPRESS_RELEASED)) {
> + err = -EINVAL;
> + goto unlock_out;
> + }
> +
> /* if in-place-update policy is enabled, don't waste time here */
> set_inode_flag(inode, FI_OPU_WRITE);
> if (f2fs_should_update_inplace(inode, NULL)) {
> @@ -2712,6 +2717,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
> clear_inode_flag(inode, FI_SKIP_WRITES);
> out:
> clear_inode_flag(inode, FI_OPU_WRITE);
> +unlock_out:
> inode_unlock(inode);
> if (!err)
> range->len = (u64)total << PAGE_SHIFT;
>
>>
>> Thanks,
prev parent reply other threads:[~2023-04-28 1:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 16:47 [PATCH v2] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED Yangtao Li
2023-04-27 9:46 ` Chao Yu
2023-04-27 16:21 ` Jaegeuk Kim
2023-04-28 1:03 ` Chao Yu [this message]
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=20801e51-623c-d2bb-6159-9d6aebc66ca9@kernel.org \
--to=chao@kernel.org \
--cc=daehojeong@google.com \
--cc=frank.li@vivo.com \
--cc=hanqi@vivo.com \
--cc=jaegeuk@kernel.org \
--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