Commit 296291cd should have made sendfile(2) killable. https://github.com/torvalds/linux/commit/296291cd > mm: make sendfile(2) killable > > Currently a simple program below issues a sendfile(2) system call which > takes about 62 days to complete in my test KVM instance. > > int fd; > off_t off = 0; > > fd = open("file", O_RDWR | O_TRUNC | O_SYNC | O_CREAT, 0644); > ftruncate(fd, 2); > lseek(fd, 0, SEEK_END); > sendfile(fd, fd, &off, 0xfffffff); > > Now you should not ask kernel to do a stupid stuff like copying 256MB in > 2-byte chunks and call fsync(2) after each chunk but if you do, sysadmin > should have a way to stop you. However, it is still not killable on btrfs. Stack trace: [<ffffffffc021ea60>] write_all_supers.isra.45+0x960/0xb00 [btrfs] [<ffffffffc02200f7>] write_ctree_super+0x17/0x20 [btrfs] [<ffffffffc026b1c7>] btrfs_sync_log+0x897/0xb40 [btrfs] [<ffffffffc023d0c8>] btrfs_sync_file+0x328/0x360 [btrfs] [<ffffffff8122fe9b>] vfs_fsync_range+0x4b/0xb0 [<ffffffffc023d307>] btrfs_file_write_iter+0x207/0x510 [btrfs] [<ffffffff811fca0b>] new_sync_write+0x9b/0xe0 [<ffffffff811fca76>] __vfs_write+0x26/0x40 [<ffffffff811fce13>] __kernel_write+0x53/0xf0 [<ffffffff8122d832>] write_pipe_buf+0x72/0xa0 [<ffffffff8122d349>] __splice_from_pipe+0xf9/0x170 [<ffffffff8122eeee>] splice_from_pipe+0x5e/0x90 [<ffffffff8122ef5d>] default_file_splice_write+0x1d/0x30 [<ffffffff8122cda6>] direct_splice_actor+0x36/0x40 [<ffffffff8122d9d6>] splice_direct_to_actor+0xe6/0x210 [<ffffffff8122db98>] do_splice_direct+0x98/0xd0 [<ffffffff811fddef>] do_sendfile+0x1bf/0x3a0 [<ffffffff811fea2e>] SyS_sendfile64+0x5e/0xb0 [<ffffffff817f02b2>] entry_SYSCALL_64_fastpath+0x16/0x75 [<ffffffffffffffff>] 0xffffffffffffffff