]> git.baikalelectronics.ru Git - kernel.git/commit
exfat: use iter_file_splice_write
authorEric Sandeen <sandeen@sandeen.net>
Sat, 2 May 2020 01:34:25 +0000 (20:34 -0500)
committerNamjae Jeon <namjae.jeon@samsung.com>
Mon, 18 May 2020 02:51:40 +0000 (11:51 +0900)
commit13086c11f2c981c3aa79d00935634500bc0928a8
tree87b97cb780e9e9405f12af20dca3c711ea8658e4
parent4bb5610f69410b69d078c15c5191e5ec9c502dd1
exfat: use iter_file_splice_write

Doing copy_file_range() on exfat with a file opened for direct IO leads
to an -EFAULT:

# xfs_io -f -d -c "truncate 32768" \
       -c "copy_range -d 16384 -l 16384 -f 0" /mnt/test/junk
copy_range: Bad address

and the reason seems to be that we go through:

default_file_splice_write
 splice_from_pipe
  __splice_from_pipe
   write_pipe_buf
    __kernel_write
     new_sync_write
      generic_file_write_iter
       generic_file_direct_write
        exfat_direct_IO
         do_blockdev_direct_IO
          iov_iter_get_pages

and land in iterate_all_kinds(), which does "return -EFAULT" for our kvec
iter.

Setting exfat's splice_write to iter_file_splice_write fixes this and lets
fsx (which originally detected the problem) run to success from
the xfstests harness.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
fs/exfat/file.c