02 Sep, 2014

1 commit

  • 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: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     

29 Aug, 2014

2 commits


26 Aug, 2014

1 commit


23 Aug, 2014

1 commit

  • This patch introduces DEF_NIDS_PER_INODE/GET_ORPHAN_BLOCKS/F2FS_CP_PACKS macro
    instead of numbers in code for readability.

    change log from v1:
    o fix typo pointed out by Jaegeuk Kim.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     

22 Aug, 2014

14 commits


20 Aug, 2014

9 commits


05 Aug, 2014

3 commits


02 Aug, 2014

2 commits


31 Jul, 2014

7 commits

  • We do not need to block on ->node_write among different node page writers e.g.
    fsync/flush, unless we have a node page writer from write_checkpoint.
    So it's better use rw_semaphore instead of mutex type for ->node_write to
    promote performance.

    Signed-off-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Chao Yu
     
  • This patch fixes wrong coding style.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • There are redundant lines in allocate_data_block.

    In this function, we call refresh_sit_entry with old seg and old curseg.
    After that, we call locate_dirty_segment with old curseg.

    But, the new address is always allocated from old curseg and
    we call locate_dirty_segment with old curseg in refresh_sit_entry.
    So, we do not need to call locate_dirty_segment with old curseg again.

    We've discussed like below:

    Jaegeuk said:
    "When considering SSR, we need to take care of the following scenario.
    - old segno : X
    - new address : Z
    - old curseg : Y
    This means, a new block is supposed to be written to Z from X.
    And Z is newly allocated in the same path from Y.

    In that case, we should trigger locate_dirty_segment for Y, since
    it was a current_segment and can be dirty owing to SSR.
    But that was not included in the dirty list."

    Changman said:
    "We already choosed old curseg(Y) and then we allocate new address(Z) from old
    curseg(Y). After that we call refresh_sit_entry(old address, new address).
    In the funcation, we call locate_dirty_segment with old seg and old curseg.
    So calling locate_dirty_segment after refresh_sit_entry again is redundant."

    Jaegeuk said:
    "Right. The new address is always allocated from old_curseg."

    Reviewed-by: Chao Yu
    Signed-off-by: Dongho Sim
    Signed-off-by: Jaegeuk Kim

    Dongho Sim
     
  • This patch adds a tracepoint for f2fs_issue_flush.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • This patch eliminates the propagation of recovery errors to the next mount.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • If the bit is already set, we don't need to reset it, and vice versa.
    Because we don't need to make the caches dirty for that.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • This patch fixes the wrongly used unlikely condition.

    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim