Linux-Fsdevel Archive on lore.kernel.org
 help / Atom feed
* [PATCH] fat: enable .splice_write to support splice on O_DIRECT file
@ 2019-02-10  9:47 Hou Tao
  2019-02-13  6:50 ` Hou Tao
  2019-02-13 17:18 ` OGAWA Hirofumi
  0 siblings, 2 replies; 4+ messages in thread
From: Hou Tao @ 2019-02-10  9:47 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, hirofumi; +Cc: houtao1

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.

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 fs/fat/file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fat/file.c b/fs/fat/file.c
index 13935ee99e1e..b3bed32946b1 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -214,6 +214,7 @@ const struct file_operations fat_file_operations = {
 #endif
 	.fsync		= fat_file_fsync,
 	.splice_read	= generic_file_splice_read,
+	.splice_write	= iter_file_splice_write,
 	.fallocate	= fat_fallocate,
 };
 
-- 
2.16.2.dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fat: enable .splice_write to support splice on O_DIRECT file
  2019-02-10  9:47 [PATCH] fat: enable .splice_write to support splice on O_DIRECT file Hou Tao
@ 2019-02-13  6:50 ` Hou Tao
  2019-02-13 17:18 ` OGAWA Hirofumi
  1 sibling, 0 replies; 4+ messages in thread
From: Hou Tao @ 2019-02-13  6:50 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, hirofumi

ping ?

On 2019/2/10 17:47, Hou Tao wrote:
> 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.
> 
> Signed-off-by: Hou Tao <houtao1@huawei.com>
> ---
>  fs/fat/file.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/fat/file.c b/fs/fat/file.c
> index 13935ee99e1e..b3bed32946b1 100644
> --- a/fs/fat/file.c
> +++ b/fs/fat/file.c
> @@ -214,6 +214,7 @@ const struct file_operations fat_file_operations = {
>  #endif
>  	.fsync		= fat_file_fsync,
>  	.splice_read	= generic_file_splice_read,
> +	.splice_write	= iter_file_splice_write,
>  	.fallocate	= fat_fallocate,
>  };
>  
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fat: enable .splice_write to support splice on O_DIRECT file
  2019-02-10  9:47 [PATCH] fat: enable .splice_write to support splice on O_DIRECT file Hou Tao
  2019-02-13  6:50 ` Hou Tao
@ 2019-02-13 17:18 ` OGAWA Hirofumi
  2019-02-13 17:19   ` OGAWA Hirofumi
  1 sibling, 1 reply; 4+ messages in thread
From: OGAWA Hirofumi @ 2019-02-13 17:18 UTC (permalink / raw)
  To: Hou Tao; +Cc: linux-kernel, linux-fsdevel

Hou Tao <houtao1@huawei.com> writes:

> 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.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
> ---
>  fs/fat/file.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/fat/file.c b/fs/fat/file.c
> index 13935ee99e1e..b3bed32946b1 100644
> --- a/fs/fat/file.c
> +++ b/fs/fat/file.c
> @@ -214,6 +214,7 @@ const struct file_operations fat_file_operations = {
>  #endif
>  	.fsync		= fat_file_fsync,
>  	.splice_read	= generic_file_splice_read,
> +	.splice_write	= iter_file_splice_write,
>  	.fallocate	= fat_fallocate,
>  };

Looks good.

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fat: enable .splice_write to support splice on O_DIRECT file
  2019-02-13 17:18 ` OGAWA Hirofumi
@ 2019-02-13 17:19   ` OGAWA Hirofumi
  0 siblings, 0 replies; 4+ messages in thread
From: OGAWA Hirofumi @ 2019-02-13 17:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Hou Tao, linux-kernel, linux-fsdevel

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:

> Hou Tao <houtao1@huawei.com> writes:
>
>> 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.
>>
>> Signed-off-by: Hou Tao <houtao1@huawei.com>
>> ---
>>  fs/fat/file.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/fat/file.c b/fs/fat/file.c
>> index 13935ee99e1e..b3bed32946b1 100644
>> --- a/fs/fat/file.c
>> +++ b/fs/fat/file.c
>> @@ -214,6 +214,7 @@ const struct file_operations fat_file_operations = {
>>  #endif
>>  	.fsync		= fat_file_fsync,
>>  	.splice_read	= generic_file_splice_read,
>> +	.splice_write	= iter_file_splice_write,
>>  	.fallocate	= fat_fallocate,
>>  };
>
> Looks good.
>
> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>
> Thanks.

Forgot to include akpm to addresses.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-10  9:47 [PATCH] fat: enable .splice_write to support splice on O_DIRECT file Hou Tao
2019-02-13  6:50 ` Hou Tao
2019-02-13 17:18 ` OGAWA Hirofumi
2019-02-13 17:19   ` OGAWA Hirofumi

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org linux-fsdevel@archiver.kernel.org
	public-inbox-index linux-fsdevel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox