Commit Graph

8 Commits

Author SHA1 Message Date
Namjae Jeon
a9ac0a3eb4 exfat: fix incorrect update of stream entry in __exfat_truncate()
At truncate, there is a problem of incorrect updating in the file entry
pointer instead of stream entry. This will cause the problem of
overwriting the time field of the file entry to new_size. This patch
change entry pointer with stream entry.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2020-06-04 15:42:57 +09:00
Tetsuhiro Kohada
9f140e2c22 exfat: optimize dir-cache
Optimize directory access based on exfat_entry_set_cache.
 - Hold bh instead of copied d-entry.
 - Modify bh->data directly instead of the copied d-entry.
 - Write back the retained bh instead of rescanning the d-entry-set.
And
 - Remove unused cache related definitions.

Signed-off-by: Tetsuhiro Kohada <kohada.tetsuhiro@dc.mitsubishielectric.co.jp>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2020-06-04 15:42:34 +09:00
Eric Sandeen
3f985aa6d5 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 <linkinjeon@kernel.org>
2020-05-03 23:26:10 +09:00
Tetsuhiro Kohada
9772742131 exfat: replace 'time_ms' with 'time_cs'
Replace time_ms  with time_cs in the file directory entry structure
and related functions.

The unit of create_time_ms/modify_time_ms in File Directory Entry are not
'milli-second', but 'centi-second'.
The exfat specification uses the term '10ms', but instead use 'cs' as in
msdos_fs.h.

Signed-off-by: Tetsuhiro Kohada <kohada.t2@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2020-05-03 23:11:32 +09:00
Eric Sandeen
09241c144b exfat: truncate atimes to 2s granularity
exfat atimes are restricted to only 2s granularity so after
we set an atime, round it down to the nearest 2s and set the
sub-second component of the timestamp to 0.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2020-04-21 10:17:24 +09:00
Namjae Jeon
4e3295fb51 exfat: fix build support from 4.1 to liunx 5.5 kernel
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
2020-02-08 19:13:34 +09:00
Namjae Jeon
f53d47cb58 exfat: linux 4.16 kernel build support
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2020-02-04 09:18:10 +09:00
Namjae Jeon
9273f3d387 exfat: initial commit
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
2020-02-03 21:47:19 +09:00