1. 24 9月, 2014 3 次提交
  2. 16 9月, 2014 1 次提交
    • J
      f2fs: fix double lock for inode page during roll-foward recovery · 60979115
      Jaegeuk Kim 提交于
      If the inode is same and its data index are needed to truncate, we can fall into
      double lock for its inode page via get_dnode_of_data.
      
      Error case is like this.
      
      1. write data 1, 2, 3, 4, 5 in inode #4.
      2. write data 100, 102, 103, 104, 105 in dnode #6 of inode #4.
      3. sync
      4. update data 100->106 in dnode #6.
      5. fsync inode #4.
      6. power-cut
      
      -> Then,
      1. go back to #3's checkpoint
      2. in do_recover_data, get_dnode_of_data() gets inode #4.
      3. detect 100->106 in dnode #6.
      4. check_index_in_prev_nodes tries to truncate 100 in dnode #6.
      5. to trigger truncate_hole, get_dnode_of_data should grab inode #4.
      6. detect *kernel hang*
      
      This patch should resolve that bug.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      60979115
  3. 10 9月, 2014 1 次提交
  4. 04 9月, 2014 1 次提交
  5. 22 8月, 2014 2 次提交
  6. 20 8月, 2014 3 次提交
  7. 02 8月, 2014 1 次提交
  8. 31 7月, 2014 1 次提交
  9. 07 6月, 2014 1 次提交
    • J
      f2fs: avoid not to call remove_dirty_inode · 86928f98
      Jaegeuk Kim 提交于
      There is an errorneous case during the recovery like below.
      
      In recovery_dentry,
       1) dir = f2fs_iget();
       2) mark the dir with FI_DELAY_IPUT
       3) goto unmap_out
      
      After the end of recovery routine, there is no dirty dentries so the dir cannot
      be released by iput in remove_dirty_dir_inode.
      
      This patch fixes such the bug case by handling the iget and iput in the
      recovery_dentry procedure.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      86928f98
  10. 07 5月, 2014 3 次提交
  11. 02 4月, 2014 1 次提交
  12. 20 3月, 2014 1 次提交
  13. 10 3月, 2014 1 次提交
  14. 27 2月, 2014 1 次提交
  15. 17 2月, 2014 3 次提交
    • J
      f2fs: fix a build warning · f6517cfc
      Jaegeuk Kim 提交于
      This patch modifies flow a little bit to avoid the following build warnings.
      
      src/fs/f2fs/recovery.c: In function ‘check_index_in_prev_nodes’:
      src/fs/f2fs/recovery.c:288:51: warning: ‘sum.<U5390>.<U52f8>.ofs_in_node’ may
      	be used uninitialized in this function [-Wmaybe-uninitialized]
      src/fs/f2fs/recovery.c:260:23: warning: ‘sum.nid’ may be used uninitialized
      	in this function [-Wmaybe-uninitialized]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      f6517cfc
    • J
      f2fs: clean up with a macro · 491c0854
      Jaegeuk Kim 提交于
      This patch adds GET_BLKOFF_FROM_SEG0 to clean up some codes.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      491c0854
    • J
      f2fs: fix to recover xattr node block · abb2366c
      Jaegeuk Kim 提交于
      If a new xattr node page was allocated and its inode is fsynced, we should
      recover the xattr node page during the roll-forward process after power-cut.
      But, previously, f2fs didn't handle that case, resulting in kernel panic as
      follows reported by Tom Li.
      
      BUG: unable to handle kernel paging request at ffffc9001c861a98
      IP: [<ffffffffa0295236>] check_index_in_prev_nodes+0x86/0x2d0 [f2fs]
      Call Trace:
       [<ffffffff815ece9b>] ? printk+0x48/0x4a
       [<ffffffffa029626a>] recover_fsync_data+0xdca/0xf50 [f2fs]
       [<ffffffffa02873ae>] f2fs_fill_super+0x92e/0x970 [f2fs]
       [<ffffffff8112c9f8>] mount_bdev+0x1b8/0x200
       [<ffffffffa0286a80>] ? f2fs_remount+0x130/0x130 [f2fs]
       [<ffffffffa0285e40>] f2fs_mount+0x10/0x20 [f2fs]
       [<ffffffff8112d4de>] mount_fs+0x3e/0x1b0
       [<ffffffff810ef4eb>] ? __alloc_percpu+0xb/0x10
       [<ffffffff8114761f>] vfs_kern_mount+0x6f/0x120
       [<ffffffff811497b9>] do_mount+0x259/0xa90
       [<ffffffff810ead1d>] ? memdup_user+0x3d/0x80
       [<ffffffff810eadb3>] ? strndup_user+0x53/0x70
       [<ffffffff8114a2c9>] SyS_mount+0x89/0xd0
       [<ffffffff815feae2>] system_call_fastpath+0x16/0x1b
      
      This patch adds a recovery function of xattr node pages.
      Reported-by: NTom Li <biergaizi@members.fsf.org>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      abb2366c
  16. 20 1月, 2014 1 次提交
  17. 06 1月, 2014 1 次提交
    • J
      f2fs: add inline_data recovery routine · 1e1bb4ba
      Jaegeuk Kim 提交于
      This patch adds a inline_data recovery routine with the following policy.
      
      [prev.] [next] of inline_data flag
         o       o  -> recover inline_data
         o       x  -> remove inline_data, and then recover data blocks
         x       o  -> remove inline_data, and then recover inline_data
         x       x  -> recover data blocks
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      1e1bb4ba
  18. 26 12月, 2013 2 次提交
  19. 23 12月, 2013 4 次提交
  20. 29 10月, 2013 1 次提交
  21. 25 10月, 2013 1 次提交
  22. 07 10月, 2013 1 次提交
    • G
      f2fs: use rw_sem instead of fs_lock(locks mutex) · e479556b
      Gu Zheng 提交于
      The fs_locks is used to block other ops(ex, recovery) when doing checkpoint.
      And each other operate routine(besides checkpoint) needs to acquire a fs_lock,
      there is a terrible problem here, if these are too many concurrency threads acquiring
      fs_lock, so that they will block each other and may lead to some performance problem,
      but this is not the phenomenon we want to see.
      Though there are some optimization patches introduced to enhance the usage of fs_lock,
      but the thorough solution is using a *rw_sem* to replace the fs_lock.
      Checkpoint routine takes write_sem, and other ops take read_sem, so that we can block
      other ops(ex, recovery) when doing checkpoint, and other ops will not disturb each other,
      this can avoid the problem described above completely.
      Because of the weakness of rw_sem, the above change may introduce a potential problem
      that the checkpoint thread might get starved if other threads are intensively locking
      the read semaphore for I/O.(Pointed out by Xu Jin)
      In order to avoid this, a wait_list is introduced, the appending read semaphore ops
      will be dropped into the wait_list if checkpoint thread is waiting for write semaphore,
      and will be waked up when checkpoint thread gives up write semaphore.
      Thanks to Kim's previous review and test, and will be very glad to see other guys'
      performance tests about this patch.
      
      V2:
        -fix the potential starvation problem.
        -use more suitable func name suggested by Xu Jin.
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      [Jaegeuk Kim: adjust minor coding standard]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      e479556b
  23. 25 9月, 2013 2 次提交
  24. 26 8月, 2013 1 次提交
    • J
      f2fs: reserve the xattr space dynamically · de93653f
      Jaegeuk Kim 提交于
      This patch enables the number of direct pointers inside on-disk inode block to
      be changed dynamically according to the size of inline xattr space.
      
      The number of direct pointers, ADDRS_PER_INODE, can be changed only if the file
      has inline xattr flag.
      
      The number of direct pointers that will be used by inline xattrs is defined as
      F2FS_INLINE_XATTR_ADDRS.
      Current patch assigns F2FS_INLINE_XATTR_ADDRS to 0 temporarily.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      de93653f
  25. 19 8月, 2013 1 次提交
  26. 09 8月, 2013 1 次提交