1. 24 11月, 2016 8 次提交
  2. 01 10月, 2016 9 次提交
    • C
      f2fs: support checkpoint error injection · 0f348028
      Chao Yu 提交于
      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: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0f348028
    • C
      f2fs: fix to recover old fault injection config in ->remount_fs · 2443b8b3
      Chao Yu 提交于
      In ->remount_fs, we didn't recover original fault injection config if
      we encounter error, fix it.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      2443b8b3
    • C
      f2fs: do fault injection initialization in default_options · 36dbd328
      Chao Yu 提交于
      Do fault injection initialization in default_options to keep consistent
      with other default option configurating.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      36dbd328
    • C
      f2fs: support configuring fault injection per superblock · 1ecc0c5c
      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: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1ecc0c5c
    • C
      f2fs: adjust display format of segment bit · d32853de
      Chao Yu 提交于
      Just adjust segment bit info printed in procfs.
      
      Before:
      1008      5|0  |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      1009      3|183|0 0 61 20 20 0 0 21 80 c0 2 e4 e 54 0 21 21 17 a 44 d0 28 e4 50 40 30 8 0 2d 32 0 5 b0 80 1 43 2 8e f8 7b 2 25 93 bf e0 73 8e 9a 19 44 60 ff e4 cc e6 8e bf f9 ff 5 3d 31 3d 13
      1010      3|1  |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      
      After:
      1008      5|0  | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      1009      4|434| ff 7d ff bf d9 3f ff e7 ff bf d7 bf ff bb be ff fb df f7 fb fa bf fb fe bb df dd ff fe ef ff fe ef e2 27 bf ab bf fb df fd bd bf fb db fc ff ff 3f ff ff bf ff 5f db 3f fb fb bf fb bf 4f ff ef
      1010      4|422| ff bb fe ff ef d7 ee ff ff fc bf ef 7d eb ec fd fb 3f 97 7f ef ff af ff db ff ff 69 bf ff f6 e7 ff fb f7 7b fb df be ff ff ef f3 fe ff ff df fe f7 fa ff b7 77 be fe fb a9 7f 87 a2 ac c7 ff 75
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d32853de
    • J
      f2fs: remove dirty inode pages in error path · bb5dada7
      Jaegeuk Kim 提交于
      When getting EIO while handling orphan inodes, we can get some dirty node
      pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
      to flush node pages. But in this case, we should prevent to do that, since
      we will try again from the start.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      bb5dada7
    • J
      f2fs: handle errors during recover_orphan_inodes · d41065e2
      Jaegeuk Kim 提交于
      This patch fixes to handle EIO during recover_orphan_inode() given the below
      panic.
      
      F2FS-fs : inject IO error in f2fs_read_end_io+0xe6/0x100 [f2fs]
      ------------[ cut here ]------------
      RIP: 0010:[<ffffffffc0b244e3>]  [<ffffffffc0b244e3>] f2fs_evict_inode+0x433/0x470 [f2fs]
      RSP: 0018:ffff92f8b7fb7c30  EFLAGS: 00010246
      RAX: ffff92fb88a13500 RBX: ffff92f890566ea0 RCX: 00000000fd3c255c
      RDX: 0000000000000001 RSI: ffff92fb88a13d90 RDI: ffff92fb8ee127e8
      RBP: ffff92f8b7fb7c58 R08: 0000000000000001 R09: ffff92fb88a13d58
      R10: 000000005a6a9373 R11: 0000000000000001 R12: 00000000fffffffb
      R13: ffff92fb8ee12000 R14: 00000000000034ca R15: ffff92fb8ee12620
      FS:  00007f1fefd8e880(0000) GS:ffff92fb95600000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007fc211d34cdb CR3: 000000012d43a000 CR4: 00000000001406e0
      Stack:
       ffff92f890566ea0 ffff92f890567078 ffffffffc0b5a0c0 ffff92f890566f28
       ffff92fb888b2000 ffff92f8b7fb7c80 ffffffffbc27ff55 ffff92f890566ea0
       ffff92fb8bf10000 ffffffffc0b5a0c0 ffff92f8b7fb7cb0 ffffffffbc28090d
      Call Trace:
       [<ffffffffbc27ff55>] evict+0xc5/0x1a0
       [<ffffffffbc28090d>] iput+0x1ad/0x2c0
       [<ffffffffc0b3304c>] recover_orphan_inodes+0x10c/0x2e0 [f2fs]
       [<ffffffffc0b2e0f4>] f2fs_fill_super+0x884/0x1150 [f2fs]
       [<ffffffffbc2644ac>] mount_bdev+0x18c/0x1c0
       [<ffffffffc0b2d870>] ? f2fs_commit_super+0x100/0x100 [f2fs]
       [<ffffffffc0b2a755>] f2fs_mount+0x15/0x20 [f2fs]
       [<ffffffffbc264e49>] mount_fs+0x39/0x170
       [<ffffffffbc28555b>] vfs_kern_mount+0x6b/0x160
       [<ffffffffbc2881df>] do_mount+0x1cf/0xd00
       [<ffffffffbc287f2c>] ? copy_mount_options+0xac/0x170
       [<ffffffffbc289003>] SyS_mount+0x83/0xd0
       [<ffffffffbc8ee880>] entry_SYSCALL_64_fastpath+0x23/0xc1
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d41065e2
    • C
      f2fs: introduce cp_lock to protect updating of ckpt_flags · aaec2b1d
      Chao Yu 提交于
      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: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: add __is_set_ckpt_flags likewise __set_ckpt_flags]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      aaec2b1d
    • J
      f2fs: use crc and cp version to determine roll-forward recovery · a468f0ef
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk@kernel.org>
      a468f0ef
  3. 23 9月, 2016 1 次提交
  4. 30 8月, 2016 1 次提交
  5. 19 8月, 2016 1 次提交
  6. 16 7月, 2016 1 次提交
    • C
      f2fs: fix to avoid data update racing between GC and DIO · 82e0a5aa
      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: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      82e0a5aa
  7. 09 7月, 2016 4 次提交
  8. 07 7月, 2016 2 次提交
  9. 14 6月, 2016 1 次提交
  10. 09 6月, 2016 1 次提交
  11. 08 6月, 2016 2 次提交
  12. 03 6月, 2016 8 次提交
  13. 30 5月, 2016 1 次提交