public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@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: Thu, 27 Apr 2023 09:21:54 -0700	[thread overview]
Message-ID: <ZEqhImQzKJJSNLNZ@google.com> (raw)
In-Reply-To: <1a602371-d9b0-7148-c916-a02c40649d53@kernel.org>

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.

+       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,

  reply	other threads:[~2023-04-27 16:22 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 [this message]
2023-04-28  1:03     ` 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=ZEqhImQzKJJSNLNZ@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=daehojeong@google.com \
    --cc=frank.li@vivo.com \
    --cc=hanqi@vivo.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