diff options
author | 2023-07-12 04:08:05 +0800 | |
---|---|---|
committer | 2023-08-14 13:41:08 -0700 | |
commit | 3a2c0e55f9bdeda9c3807d6ac23d62f027f6caa9 (patch) | |
tree | 889bc4f15af3c2fbd62121d55256af5bc71b53d9 | |
parent | f2fs: don't reopen the main block device in f2fs_scan_devices (diff) | |
download | wireguard-linux-3a2c0e55f9bdeda9c3807d6ac23d62f027f6caa9.tar.xz wireguard-linux-3a2c0e55f9bdeda9c3807d6ac23d62f027f6caa9.zip |
f2fs: allow f2fs_ioc_{,de}compress_file to be interrupted
This patch allows f2fs_ioc_{,de}compress_file() to be interrupted, so that,
userspace won't be blocked when manual {,de}compression on large file is
interrupted by signal.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/f2fs/file.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index d9073afe021f..79cb6a41f128 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -4107,6 +4107,12 @@ static int f2fs_ioc_decompress_file(struct file *filp) count -= len; page_idx += len; + + cond_resched(); + if (fatal_signal_pending(current)) { + ret = -EINTR; + break; + } } if (!ret) @@ -4181,6 +4187,12 @@ static int f2fs_ioc_compress_file(struct file *filp) count -= len; page_idx += len; + + cond_resched(); + if (fatal_signal_pending(current)) { + ret = -EINTR; + break; + } } if (!ret) |