22 Oct, 2020

2 commits


12 Aug, 2020

2 commits

  • MediaFailure and VolumeDirty should be retained if these are set before
    mounting.

    In '3.1.13.3 Media Failure Field' of exfat specification describe:

    If, upon mounting a volume, the value of this field is 1,
    implementations which scan the entire volume for media failures and
    record all failures as "bad" clusters in the FAT (or otherwise resolve
    media failures) may clear the value of this field to 0.

    Therefore, We should not clear MediaFailure without scanning volume.

    In '8.1 Recommended Write Ordering' of exfat specification describe:

    Clear the value of the VolumeDirty field to 0, if its value prior to
    the first step was 0.

    Therefore, We should not clear VolumeDirty after mounting.
    Also rename ERR_MEDIUM to MEDIA_FAILURE.

    Signed-off-by: Tetsuhiro Kohada
    Signed-off-by: Namjae Jeon

    Tetsuhiro Kohada
     
  • Add error check when synchronously updating dir-entries.

    Suggested-by: Sungjong Seo
    Signed-off-by: Tetsuhiro Kohada
    Signed-off-by: Namjae Jeon

    Tetsuhiro Kohada
     

21 Jul, 2020

1 commit


29 Jun, 2020

1 commit

  • generic_file_fsync() exfat used could not guarantee the consistency of
    a file because it has flushed not dirty metadata but only dirty data pages
    for a file.

    Instead of that, use exfat_file_fsync() for files and directories so that
    it guarantees to commit both the metadata and data pages for a file.

    Signed-off-by: Sungjong Seo
    Signed-off-by: Namjae Jeon

    Sungjong Seo
     

09 Jun, 2020

3 commits

  • 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. Fix it to
    update stream entry.

    Fixes: 98d917047e8b ("exfat: add file operations")
    Cc: stable@vger.kernel.org # v5.7
    Signed-off-by: Namjae Jeon

    Namjae Jeon
     
  • 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
    Reviewed-by: Sungjong Seo
    Signed-off-by: Namjae Jeon

    Tetsuhiro Kohada
     
  • 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
    Signed-off-by: Namjae Jeon

    Tetsuhiro Kohada
     

18 May, 2020

1 commit

  • 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
    Signed-off-by: Namjae Jeon

    Eric Sandeen
     

22 Apr, 2020

1 commit

  • The timestamp for access_time has double seconds granularity(There is no
    10msIncrement field for access_time unlike create/modify_time).
    exfat's 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
    Signed-off-by: Namjae Jeon

    Eric Sandeen
     

06 Mar, 2020

1 commit

  • This adds the implementation of file operations for exfat.

    Signed-off-by: Namjae Jeon
    Signed-off-by: Sungjong Seo
    Reviewed-by: Pali Rohár
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Al Viro

    Namjae Jeon