1. 12 2月, 2015 2 次提交
    • C
      f2fs: merge flags in struct f2fs_sb_info · caf0047e
      Chao Yu 提交于
      Currently, there are several variables with Boolean type as below:
      
      struct f2fs_sb_info {
      ...
      	int s_dirty;
      	bool need_fsck;
      	bool s_closing;
      ...
      	bool por_doing;
      ...
      }
      
      For this there are some issues:
      1. there are some space of f2fs_sb_info is wasted due to aligning after Boolean
         type variables by compiler.
      2. if we continuously add new flag into f2fs_sb_info, structure will be messed
         up.
      
      So in this patch, we try to:
      1. switch s_dirty to Boolean type variable since it has two status 0/1.
      2. merge s_dirty/need_fsck/s_closing/por_doing variables into s_flag.
      3. introduce an enum type which can indicate different states of sbi.
      4. use new introduced universal interfaces is_sbi_flag_set/{set,clear}_sbi_flag
         to operate flags for sbi.
      
      After that, above issues will be fixed.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      caf0047e
    • J
      f2fs: leave comment for code readability · bc4a1f87
      Jaegeuk Kim 提交于
      During the recovery, any xattr blocks should not be found, since they are
      written into cold log, not the warm node chain.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      bc4a1f87
  2. 10 1月, 2015 1 次提交
  3. 09 12月, 2014 1 次提交
  4. 24 11月, 2014 1 次提交
  5. 04 11月, 2014 2 次提交
  6. 01 10月, 2014 2 次提交
    • J
      f2fs: check the use of macros on block counts and addresses · 7cd8558b
      Jaegeuk Kim 提交于
      This patch cleans up the existing and new macros for readability.
      
      Rule is like this.
      
               ,-----------------------------------------> MAX_BLKADDR -,
               |  ,------------- TOTAL_BLKS ----------------------------,
               |  |                                                     |
               |  ,- seg0_blkaddr   ,----- sit/nat/ssa/main blkaddress  |
      block    |  | (SEG0_BLKADDR)  | | | |   (e.g., MAIN_BLKADDR)      |
      address  0..x................ a b c d .............................
                  |                                                     |
      global seg# 0...................... m .............................
                  |                       |                             |
                  |                       `------- MAIN_SEGS -----------'
                  `-------------- TOTAL_SEGS ---------------------------'
                                          |                             |
       seg#                               0..........xx..................
      
      = Note =
       o GET_SEGNO_FROM_SEG0 : blk address -> global segno
       o GET_SEGNO           : blk address -> segno
       o START_BLOCK         : segno -> starting block address
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7cd8558b
    • J
      f2fs: introduce cp_control structure · 75ab4cb8
      Jaegeuk Kim 提交于
      This patch add a new data structure to control checkpoint parameters.
      Currently, it presents the reason of checkpoint such as is_umount and normal
      sync.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      75ab4cb8
  7. 24 9月, 2014 3 次提交
  8. 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
  9. 10 9月, 2014 1 次提交
  10. 04 9月, 2014 1 次提交
  11. 22 8月, 2014 2 次提交
  12. 20 8月, 2014 3 次提交
  13. 02 8月, 2014 1 次提交
  14. 31 7月, 2014 1 次提交
  15. 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
  16. 07 5月, 2014 3 次提交
  17. 02 4月, 2014 1 次提交
  18. 20 3月, 2014 1 次提交
  19. 10 3月, 2014 1 次提交
  20. 27 2月, 2014 1 次提交
  21. 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
  22. 20 1月, 2014 1 次提交
  23. 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
  24. 26 12月, 2013 2 次提交
  25. 23 12月, 2013 3 次提交