1. 02 6月, 2015 1 次提交
    • C
      f2fs: support RENAME_WHITEOUT · 7e01e7ad
      Chao Yu 提交于
      As the description of rename in manual, RENAME_WHITEOUT is a special operation
      that only makes sense for overlay/union type filesystem.
      
      When performing rename with RENAME_WHITEOUT, dst will be replace with src, and
      meanwhile, a 'whiteout' will be create with name of src.
      
      A "whiteout" is designed to be a char device with 0,0 device number, it has
      specially meaning for stackable filesystem. In these filesystems, there are
      multiple layers exist, and only top of these can be modified. So a whiteout
      in top layer is used to hide a corresponding file in lower layer, as well
      removal of whiteout will make the file appear.
      
      Now in overlayfs, when we rename a file which is exist in lower layer, it
      will be copied up to upper if it is not on upper layer yet, and then rename
      it on upper layer, source file will be whiteouted to hide corresponding file
      in lower layer at the same time.
      
      So in upper layer filesystem, implementation of RENAME_WHITEOUT provide a
      atomic operation for stackable filesystem to support rename operation.
      
      There are multiple ways to implement RENAME_WHITEOUT in log of this commit:
      7dcf5c3e ("xfs: add RENAME_WHITEOUT support") which pointed out by
      Dave Chinner.
      
      For now, we just try to follow the way that xfs/ext4 use.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7e01e7ad
  2. 29 5月, 2015 7 次提交
  3. 05 5月, 2015 1 次提交
  4. 17 4月, 2015 2 次提交
  5. 16 4月, 2015 1 次提交
  6. 11 4月, 2015 1 次提交
    • J
      f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries · 510022a8
      Jaegeuk Kim 提交于
      If f2fs was corrupted with missing dot dentries, it needs to recover them after
      fsck.f2fs detection.
      
      The underlying precedure is:
      
      1. The fsck.f2fs remains F2FS_INLINE_DOTS flag in directory inode, if it detects
      missing dot dentries.
      
      2. When f2fs looks up the corrupted directory, it triggers f2fs_add_link with
      proper inode numbers and their dot and dotdot names.
      
      3. Once f2fs recovers the directory without errors, it removes F2FS_INLINE_DOTS
      finally.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      510022a8
  7. 04 3月, 2015 1 次提交
  8. 12 2月, 2015 1 次提交
  9. 24 11月, 2014 1 次提交
  10. 10 11月, 2014 1 次提交
  11. 05 11月, 2014 1 次提交
    • J
      f2fs: revisit inline_data to avoid data races and potential bugs · b3d208f9
      Jaegeuk Kim 提交于
      This patch simplifies the inline_data usage with the following rule.
      1. inline_data is set during the file creation.
      2. If new data is requested to be written ranges out of inline_data,
       f2fs converts that inode permanently.
      3. There is no cases which converts non-inline_data inode to inline_data.
      4. The inline_data flag should be changed under inode page lock.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b3d208f9
  12. 04 11月, 2014 4 次提交
  13. 01 10月, 2014 1 次提交
  14. 04 9月, 2014 1 次提交
  15. 02 9月, 2014 1 次提交
    • C
      f2fs: reposition unlock_new_inode to prevent accessing invalid inode · b73e5282
      Chao Yu 提交于
      As the race condition on the inode cache, following scenario can appear:
      [Thread a]				[Thread b]
      					->f2fs_mkdir
      					  ->f2fs_add_link
      					    ->__f2fs_add_link
      					      ->init_inode_metadata failed here
      ->gc_thread_func
        ->f2fs_gc
          ->do_garbage_collect
            ->gc_data_segment
              ->f2fs_iget
                ->iget_locked
                  ->wait_on_inode
      					  ->unlock_new_inode
              ->move_data_page
      					  ->make_bad_inode
      					  ->iput
      
      When we fail in create/symlink/mkdir/mknod/tmpfile, the new allocated inode
      should be set as bad to avoid being accessed by other thread. But in above
      scenario, it allows f2fs to access the invalid inode before this inode was set
      as bad.
      This patch fix the potential problem, and this issue was found by code review.
      
      change log from v1:
       o Add condition judgment in gc_data_segment() suggested by Changman Lee.
       o use iget_failed to simplify code.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b73e5282
  16. 22 8月, 2014 1 次提交
  17. 20 8月, 2014 1 次提交
  18. 25 7月, 2014 1 次提交
  19. 10 7月, 2014 4 次提交
  20. 09 7月, 2014 2 次提交
    • J
      f2fs: do checkpoint for the renamed inode · b2c08299
      Jaegeuk Kim 提交于
      If an inode is renamed, it should be registered as file_lost_pino to conduct
      checkpoint at f2fs_sync_file.
      Otherwise, the inode cannot be recovered due to no dent_mark in the following
      scenario.
      
      Note that, this scenario is from xfstests/322.
      
      1. create "a"
      2. fsync "a"
      3. rename "a" to "b"
      4. fsync "b"
      5. Sudden power-cut
      
      After recovery is done, "b" should be seen.
      However, the result shows "a", since the recovery procedure does not enter
      recover_dentry due to no dent_mark.
      
      The reason is like below.
      - The nid of "a" is checkpointed during #2, f2fs_sync_file.
      - The inode page for "b" produced by #3 is written without dent_mark by
      sync_node_pages.
      
      So, this patch fixes this bug by assinging file_lost_pino to the "a"'s inode.
      If the pino is lost, f2fs_sync_file conducts checkpoint, and then recovers
      the latest pino and its dentry information for further recovery.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b2c08299
    • C
      f2fs: release new entry page correctly in error path of f2fs_rename · dd4d961f
      Chao Yu 提交于
      This patch correct releasing code of new_page to avoid BUG_ON in error patch of
      f2fs_rename.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      dd4d961f
  21. 08 5月, 2014 1 次提交
  22. 07 4月, 2014 1 次提交
  23. 20 3月, 2014 1 次提交
  24. 26 1月, 2014 1 次提交
  25. 22 1月, 2014 1 次提交
  26. 23 12月, 2013 1 次提交