]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: allow compression for mmap files in compress_mode=user
authorSungjong Seo <sj1557.seo@samsung.com>
Tue, 24 May 2022 01:29:11 +0000 (10:29 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:42:16 +0000 (14:42 +0200)
[ Upstream commit 66d34fcbbe63ebd8584b792e0d741f6648100894 ]

Since commit e3c548323d32 ("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 <sj1557.seo@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c

index 863518695ea6c3226fddef6779109813f17786f1..9a676ea080e49edb29934adb549a96425f2333bd 100644 (file)
@@ -3914,11 +3914,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;
@@ -3986,11 +3981,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;