12 Jan, 2017

1 commit


06 Jan, 2017

2 commits


01 Oct, 2016

6 commits

  • This patch adds to support checkpoint error injection in f2fs for testing
    fatal error tolerance, it will be useful that it can simulate abnormal
    power off by f2fs itself instead of calling godown ioctl by running apps.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • Previously, we only support global fault injection configuration, so that
    when we configure type/rate of fault injection through sysfs, mount
    option, it will influence all f2fs partition which is being used.

    It is not make sence, since it will be not convenient if developer want
    to test separated partitions with different fault injection rate/type
    simultaneously, also it's not possible to enable fault injection in one
    partition and disable fault injection in other one.

    >From now on, we move global configuration of fault injection in module
    into per-superblock, hence injection testing can be more flexible.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • This patch improves the migration of dirty pages and allows migrating atomic
    written pages that F2FS uses in Page Cache. Instead of the fallback releasing
    page path, it provides better performance for memory compaction, CMA and other
    users of memory page migrating. For dirty pages, there is no need to write back
    first when migrating. For an atomic written page before committing, we can
    migrate the page and update the related 'inmem_pages' list at the same time.

    Signed-off-by: Weichao Guo
    Reviewed-by: Chao Yu
    [Jaegeuk Kim: fix some coding style]
    Signed-off-by: Jaegeuk Kim

    Weichao Guo
     
  • This patch introduces spinlock to protect updating process of ckpt_flags
    field in struct f2fs_checkpoint, it avoids incorrectly updating in race
    condition.

    Signed-off-by: Chao Yu
    [Jaegeuk Kim: add __is_set_ckpt_flags likewise __set_ckpt_flags]
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • Making updating of sbi flag atomic by using {test,set,clear}_bit,
    otherwise in concurrency scenario, the flag could be updated incorrectly.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • Previously, we used cp_version only to detect recoverable dnodes.
    In order to avoid same garbage cp_version, we needed to truncate the next
    dnode during checkpoint, resulting in additional discard or data write.
    If we can distinguish this by using crc in addition to cp_version, we can
    remove this overhead.

    There is backward compatibility concern where it changes node_footer layout.
    So, this patch introduces a new checkpoint flag, CP_CRC_RECOVERY_FLAG, to
    detect new layout. New layout will be activated only when this flag is set.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

23 Sep, 2016

3 commits


14 Sep, 2016

1 commit


08 Sep, 2016

4 commits

  • Add roll-forward recovery process for encrypted dentry, so the first fsync
    issued to an encrypted file does not need writing checkpoint.

    This improves the performance of the following test at thousands of small
    files: open -> write -> fsync -> close

    Signed-off-by: Shuoran Liu
    Acked-by: Chao Yu
    [Jaegeuk Kim: modify kernel message to show encrypted names]
    Signed-off-by: Jaegeuk Kim

    Shuoran Liu
     
  • This patch enhances the xattr consistency of dirs from suddern power-cuts.

    Possible scenario would be:
    1. dir->setxattr used by per-file encryption
    2. file->setxattr goes into inline_xattr
    3. file->fsync

    In that case, we should do checkpoint for #1.
    Otherwise we'd lose dir's key information for the file given #2.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • Like most filesystems, f2fs will issue discard command synchronously, so
    when user trigger fstrim through ioctl, multiple discard commands will be
    issued serially with sync mode, which makes poor performance.

    In this patch we try to support async discard, so that all discard
    commands can be issued and be waited for endio in batch to improve
    performance.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • When creating new inode, security_inode_init_security will be called for
    initializing security info related to the inode, and filename is passed to
    security module, it helps security module such as SElinux to know which
    rule or label could be applied for the inode with specified name.

    Previously, if new inode is created as an encrypted one, f2fs will transfer
    encrypted filename to security module which may fail the check of security
    policy belong to the inode. So in order to this issue, alter to transfer
    original unencrypted filename instead.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     

30 Aug, 2016

3 commits


25 Aug, 2016

1 commit


19 Aug, 2016

1 commit

  • LKP reported -36.3% regression of fsmark.files_per_sec due to this patch.
    I've confirmed that fxmark [1] has also slight regression for DWAL.

    [1] https://github.com/sslab-gatech/fxmark

    This reverts commit ec795418c41850056feb956534edf059dc1155d4.

    Jaegeuk Kim
     

06 Aug, 2016

1 commit

  • Pull qstr constification updates from Al Viro:
    "Fairly self-contained bunch - surprising lot of places passes struct
    qstr * as an argument when const struct qstr * would suffice; it
    complicates analysis for no good reason.

    I'd prefer to feed that separately from the assorted fixes (those are
    in #for-linus and with somewhat trickier topology)"

    * 'work.const-qstr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    qstr: constify instances in adfs
    qstr: constify instances in lustre
    qstr: constify instances in f2fs
    qstr: constify instances in ext2
    qstr: constify instances in vfat
    qstr: constify instances in procfs
    qstr: constify instances in fuse
    qstr constify instances in fs/dcache.c
    qstr: constify instances in nfs
    qstr: constify instances in ocfs2
    qstr: constify instances in autofs4
    qstr: constify instances in hfs
    qstr: constify instances in hfsplus
    qstr: constify instances in logfs
    qstr: constify dentry_init_security

    Linus Torvalds
     

31 Jul, 2016

1 commit


28 Jul, 2016

1 commit

  • Pull f2fs updates from Jaegeuk Kim:
    "The major change in this version is mitigating cpu overheads on write
    paths by replacing redundant inode page updates with mark_inode_dirty
    calls. And we tried to reduce lock contentions as well to improve
    filesystem scalability. Other feature is setting F2FS automatically
    when detecting host-managed SMR.

    Enhancements:
    - ioctl to move a range of data between files
    - inject orphan inode errors
    - avoid flush commands congestion
    - support lazytime

    Bug fixes:
    - return proper results for some dentry operations
    - fix deadlock in add_link failure
    - disable extent_cache for fcollapse/finsert"

    * tag 'for-f2fs-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (68 commits)
    f2fs: clean up coding style and redundancy
    f2fs: get victim segment again after new cp
    f2fs: handle error case with f2fs_bug_on
    f2fs: avoid data race when deciding checkpoin in f2fs_sync_file
    f2fs: support an ioctl to move a range of data blocks
    f2fs: fix to report error number of f2fs_find_entry
    f2fs: avoid memory allocation failure due to a long length
    f2fs: reset default idle interval value
    f2fs: use blk_plug in all the possible paths
    f2fs: fix to avoid data update racing between GC and DIO
    f2fs: add maximum prefree segments
    f2fs: disable extent_cache for fcollapse/finsert inodes
    f2fs: refactor __exchange_data_block for speed up
    f2fs: fix ERR_PTR returned by bio
    f2fs: avoid mark_inode_dirty
    f2fs: move i_size_write in f2fs_write_end
    f2fs: fix to avoid redundant discard during fstrim
    f2fs: avoid mismatching block range for discard
    f2fs: fix incorrect f_bfree calculation in ->statfs
    f2fs: use percpu_rw_semaphore
    ...

    Linus Torvalds
     

21 Jul, 2016

3 commits


16 Jul, 2016

3 commits

  • The default value of idle interval is 2 mins, but for most time when
    screen shutdown, there are still operations during the 2 mins interval,
    and gc's sleep time is about 30 secs to 60 secs, so there is almost no
    chance for GC thread to do garbage collecting.

    Set default value of idle interval value from 2 mins to 5 secs for
    fixing.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • Datas in file can be operated by GC and DIO simultaneously, so we will
    face race case as below:

    For write case:
    Thread A Thread B
    - generic_file_direct_write
    - invalidate_inode_pages2_range
    - f2fs_direct_IO
    - do_blockdev_direct_IO
    - do_direct_IO
    - get_more_blocks
    - f2fs_gc
    - do_garbage_collect
    - gc_data_segment
    - move_data_page
    - do_write_data_page
    migrate data block to new block address
    - dio_bio_submit
    update user data to old block address

    For read case:
    Thread A Thread B
    - generic_file_direct_write
    - invalidate_inode_pages2_range
    - f2fs_direct_IO
    - do_blockdev_direct_IO
    - do_direct_IO
    - get_more_blocks
    - f2fs_balance_fs
    - f2fs_gc
    - do_garbage_collect
    - gc_data_segment
    - move_data_page
    - do_write_data_page
    migrate data block to new block address
    - write_checkpoint
    - do_checkpoint
    - clear_prefree_segments
    - f2fs_issue_discard
    discard old block adress
    - dio_bio_submit
    update user buffer from obsolete block address

    In order to fix this, for one file, we should let DIO and GC getting exclusion
    against with each other.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • This reduces the elapsed time to do xfstests/generic/017.

    Before: 458 s
    After: 390 s

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

09 Jul, 2016

4 commits


07 Jul, 2016

3 commits


16 Jun, 2016

1 commit

  • If dotdot directory is corrupted, its slot may be ocupied by another
    file. In this case, dentry[1] is not the parent directory. Rename and
    cross-rename will update the inode in dentry[1] incorrectly. This
    patch finds dotdot dentry by name.

    Signed-off-by: Sheng Yong
    [Jaegeuk Kim: remove wron bug_on]
    Signed-off-by: Jaegeuk Kim

    Sheng Yong
     

14 Jun, 2016

1 commit