1. 20 8月, 2015 1 次提交
  2. 06 8月, 2015 1 次提交
    • C
      f2fs: recover invalid/reserved block address for fsynced file · 12a8343e
      Chao Yu 提交于
      When testing with generic/101 in xfstests, error message outputed as below:
      
          --- tests/generic/101.out
          +++ results//generic/101.out.bad
          @@ -10,10 +10,14 @@
           File foo content after log replay:
           0000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
           *
          -0200000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
          +0200000 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
           *
           0372000
          ...
          (Run 'diff -u tests/generic/101.out results/generic/101.out.bad'  to see the entire diff)
      
      The test flow is like below:
      1. pwrite foo -S 0xaa 0 64K
      2. pwrite foo -S 0xbb 64K 61K
      3. sync
      4. truncate foo 64K
      5. truncate foo 125K
      6. fsync foo
      7. flakey drop writes
      8. umount
      
      After this test, we expect the data of recovered file will have the first
      64k of data filling with value 0xaa and the next 61k of data filling with
      value 0x00 because we have fsynced it before dropping writes in dm.
      
      In f2fs, during recovering, we will only recover the valid block address
      in direct node page if it is marked as a fsynced dnode, but block address
      which means invalid/reserved (with value NULL_ADDR/NEW_ADDR) will not be
      recovered. So, the file recovered shows its incorrect data 0xbb in range of
      [61k, 125k].
      
      In this patch, we fix to recover invalid/reserved block during recover flow.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      12a8343e
  3. 05 8月, 2015 1 次提交
    • C
      f2fs: invalidate temporary meta page · e90c2d28
      Chao Yu 提交于
      To avoid meeting garbage data in next free node block at the end of warm
      node chain when doing recovery, we will try to zero out that invalid block.
      
      If the device is not support discard, our way for zeroing out block is:
      grabbing a temporary zeroed page in meta inode, then, issue write request
      with this page.
      
      But, we forget to release that temporary page, so our memory usage will
      increase without gaining any hit ratio benefit, so it's better to free it
      for saving memory.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e90c2d28
  4. 03 6月, 2015 1 次提交
  5. 29 5月, 2015 2 次提交
  6. 08 5月, 2015 1 次提交
  7. 17 4月, 2015 1 次提交
  8. 11 4月, 2015 5 次提交
  9. 04 3月, 2015 3 次提交
  10. 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
  11. 10 1月, 2015 1 次提交
  12. 09 12月, 2014 1 次提交
  13. 24 11月, 2014 1 次提交
  14. 04 11月, 2014 2 次提交
  15. 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
  16. 24 9月, 2014 3 次提交
  17. 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
  18. 10 9月, 2014 1 次提交
  19. 04 9月, 2014 1 次提交
  20. 22 8月, 2014 2 次提交
  21. 20 8月, 2014 3 次提交
  22. 02 8月, 2014 1 次提交
  23. 31 7月, 2014 1 次提交
  24. 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
  25. 07 5月, 2014 1 次提交