Skip to content

Commit 3a2c0e5

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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 <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 51bf8d3 commit 3a2c0e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

fs/f2fs/file.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,6 +4107,12 @@ static int f2fs_ioc_decompress_file(struct file *filp)
41074107

41084108
count -= len;
41094109
page_idx += len;
4110+
4111+
cond_resched();
4112+
if (fatal_signal_pending(current)) {
4113+
ret = -EINTR;
4114+
break;
4115+
}
41104116
}
41114117

41124118
if (!ret)
@@ -4181,6 +4187,12 @@ static int f2fs_ioc_compress_file(struct file *filp)
41814187

41824188
count -= len;
41834189
page_idx += len;
4190+
4191+
cond_resched();
4192+
if (fatal_signal_pending(current)) {
4193+
ret = -EINTR;
4194+
break;
4195+
}
41844196
}
41854197

41864198
if (!ret)

0 commit comments

Comments
 (0)