* [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression
@ 2022-08-04 13:41 Chao Yu
2022-08-04 18:28 ` Eric Biggers
0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2022-08-04 13:41 UTC (permalink / raw)
To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel
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))
--
2.36.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression
2022-08-04 13:41 [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression Chao Yu
@ 2022-08-04 18:28 ` Eric Biggers
2022-08-05 1:05 ` Chao Yu
0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2022-08-04 18:28 UTC (permalink / raw)
To: Chao Yu; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression
2022-08-04 18:28 ` Eric Biggers
@ 2022-08-05 1:05 ` Chao Yu
0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2022-08-05 1:05 UTC (permalink / raw)
To: Eric Biggers; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel
On 2022/8/5 2:28, Eric Biggers wrote:
> How is this different from the same check that occurs earlier in the function?
Oops, I missed that one, please ignore this patch.
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-05 1:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 13:41 [f2fs-dev] [PATCH] f2fs: fix to check compression feature before enabling file compression Chao Yu
2022-08-04 18:28 ` Eric Biggers
2022-08-05 1:05 ` Chao Yu
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).