From: Eric Biggers <ebiggers@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression
Date: Thu, 4 Aug 2022 18:28:59 +0000 [thread overview]
Message-ID: <YuwP67c0oNjhojmt@gmail.com> (raw)
In-Reply-To: <20220804134140.14455-1-chao@kernel.org>
On Thu, Aug 04, 2022 at 09:41:40PM +0800, Chao Yu wrote:
> From: Chao Yu <chao.yu@oppo.com>
>
> This patch disallow to enable file compression in image which doesn't
> support compression feature.
>
> Signed-off-by: Chao Yu <chao.yu@oppo.com>
> ---
> fs/f2fs/file.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 24f5b02c78e7..4a3f4eaa3fc5 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -1872,6 +1872,8 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
> if (!f2fs_disable_compressed_file(inode))
> return -EINVAL;
> } else {
> + if (!f2fs_sb_has_compression(F2FS_I_SB(inode)))
> + return -EOPNOTSUPP;
> if (!f2fs_may_compress(inode))
> return -EINVAL;
> if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode))
> --
How is this different from the same check that occurs earlier in the function?
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression
Date: Thu, 4 Aug 2022 18:28:59 +0000 [thread overview]
Message-ID: <YuwP67c0oNjhojmt@gmail.com> (raw)
In-Reply-To: <20220804134140.14455-1-chao@kernel.org>
On Thu, Aug 04, 2022 at 09:41:40PM +0800, Chao Yu wrote:
> From: Chao Yu <chao.yu@oppo.com>
>
> This patch disallow to enable file compression in image which doesn't
> support compression feature.
>
> Signed-off-by: Chao Yu <chao.yu@oppo.com>
> ---
> fs/f2fs/file.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 24f5b02c78e7..4a3f4eaa3fc5 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -1872,6 +1872,8 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
> if (!f2fs_disable_compressed_file(inode))
> return -EINVAL;
> } else {
> + if (!f2fs_sb_has_compression(F2FS_I_SB(inode)))
> + return -EOPNOTSUPP;
> if (!f2fs_may_compress(inode))
> return -EINVAL;
> if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode))
> --
How is this different from the same check that occurs earlier in the function?
- Eric
next prev parent reply other threads:[~2022-08-04 18:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 13:41 [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression Chao Yu
2022-08-04 13:41 ` Chao Yu
2022-08-04 18:28 ` Eric Biggers [this message]
2022-08-04 18:28 ` [f2fs-dev] " Eric Biggers
2022-08-05 1:05 ` Chao Yu
2022-08-05 1:05 ` 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=YuwP67c0oNjhojmt@gmail.com \
--to=ebiggers@kernel.org \
--cc=chao@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.