From: Sungjong Seo Date: Tue, 24 May 2022 01:29:11 +0000 (+0900) Subject: f2fs: allow compression for mmap files in compress_mode=user X-Git-Tag: baikal/mips/sdk5.9~117 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f6c7597b1af4f92d940cf0dfc4e7b474fff295b2;p=kernel.git f2fs: allow compression for mmap files in compress_mode=user [ Upstream commit 58c78c481f54e9be53e69c132867f59cb39daa67 ] Since commit 7c1c191e44c1 ("f2fs: let's allow compression for mmap files"), it has been allowed to compress mmap files. However, in compress_mode=user, it is not allowed yet. To keep the same concept in both compress_modes, f2fs_ioc_(de)compress_file() should also allow it. Let's remove checking mmap files in f2fs_ioc_(de)compress_file() so that the compression for mmap files is also allowed in compress_mode=user. Signed-off-by: Sungjong Seo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index eacc80ac160fb..0669464a942ac 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -4011,11 +4011,6 @@ static int f2fs_ioc_decompress_file(struct file *filp, unsigned long arg) goto out; } - if (f2fs_is_mmap_file(inode)) { - ret = -EBUSY; - goto out; - } - ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) goto out; @@ -4083,11 +4078,6 @@ static int f2fs_ioc_compress_file(struct file *filp, unsigned long arg) goto out; } - if (f2fs_is_mmap_file(inode)) { - ret = -EBUSY; - goto out; - } - ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) goto out;