提交 67ceb1ec 编写于 作者: H Hou Tao 提交者: Linus Torvalds

fat: enable .splice_write to support splice on O_DIRECT file

Now splice() on O_DIRECT-opened fat file will return -EFAULT, that is
because the default .splice_write, namely default_file_splice_write(),
will construct an ITER_KVEC iov_iter and dio_refill_pages() in dio path
can not handle it.

Fix it by implementing .splice_write through iter_file_splice_write().

Spotted by xfs-tests generic/091.

Link: http://lkml.kernel.org/r/20190210094754.56355-1-houtao1@huawei.comSigned-off-by: NHou Tao <houtao1@huawei.com>
Acked-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 660c9fc7
...@@ -214,6 +214,7 @@ const struct file_operations fat_file_operations = { ...@@ -214,6 +214,7 @@ const struct file_operations fat_file_operations = {
#endif #endif
.fsync = fat_file_fsync, .fsync = fat_file_fsync,
.splice_read = generic_file_splice_read, .splice_read = generic_file_splice_read,
.splice_write = iter_file_splice_write,
.fallocate = fat_fallocate, .fallocate = fat_fallocate,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册