diff mbox series

[f2fs-dev,1/2] f2fs: allow f2fs_ioc_{, de}compress_file to be interrupted

Message ID 20230711200806.4884-1-chao@kernel.org (mailing list archive)
State Accepted
Commit eb0e30a6f8a71161a594fef7f60b2a3c97ef2e86
Headers show
Series [f2fs-dev,1/2] f2fs: allow f2fs_ioc_{, de}compress_file to be interrupted | expand

Commit Message

Chao Yu July 11, 2023, 8:08 p.m. UTC
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>
---
 fs/f2fs/file.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

patchwork-bot+f2fs@kernel.org July 17, 2023, 5:34 p.m. UTC | #1
Hello:

This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Wed, 12 Jul 2023 04:08:05 +0800 you wrote:
> 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>
> ---
>  fs/f2fs/file.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

Here is the summary with links:
  - [f2fs-dev,1/2] f2fs: allow f2fs_ioc_{, de}compress_file to be interrupted
    https://git.kernel.org/jaegeuk/f2fs/c/eb0e30a6f8a7
  - [f2fs-dev,2/2] f2fs: compress: don't {, de}compress non-full cluster
    https://git.kernel.org/jaegeuk/f2fs/c/10c7134ee440

You are awesome, thank you!
diff mbox series

Patch

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)