BACKPORT: f2fs: allow compression for mmap files in compress_mode=user

Since commit e3c548323d ("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.

Bug: 228919347
Bug: 267580491
Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 77142c3cf71f09dcf3fb2ef43926a29e2cfd2ae3)
Change-Id: I31798dfb851be6ee7e5156be8c46fe007583ee55
(cherry picked from commit d85467fdca7c61be37cfd65434dffba3fb4d978d)
This commit is contained in:
Sungjong Seo
2022-05-24 10:29:11 +09:00
committed by Treehugger Robot
parent f069ba2b3d
commit 246a996565

View File

@@ -4121,11 +4121,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;
@@ -4193,11 +4188,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;