1. 28 May, 2015 1 commit
  2. 10 Apr, 2015 5 commits
    • Jaegeuk Kim's avatar
      f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries · 510022a8
      Jaegeuk Kim authored
      
      
      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: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      510022a8
    • Chao Yu's avatar
      f2fs: split set_data_blkaddr from f2fs_update_extent_cache · 216a620a
      Chao Yu authored
      
      
      Split __set_data_blkaddr from f2fs_update_extent_cache for readability.
      
      Additionally rename __set_data_blkaddr to set_data_blkaddr for exporting.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      216a620a
    • Wanpeng Li's avatar
      f2fs: enable fast symlink by utilizing inline data · 368a0e40
      Wanpeng Li authored
      
      
      Fast symlink can utilize inline data flow to avoid using any
      i_addr region, since we need to handle many cases such as
      truncation, roll-forward recovery, and fsck/dump tools.
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@linux.intel.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      368a0e40
    • Jaegeuk Kim's avatar
      f2fs: avoid wrong f2fs_bug_on when truncating inline_data · 83e21db6
      Jaegeuk Kim authored
      
      
      This patch removes wrong f2fs_bug_on in truncate_inline_inode.
      
      When there is no space, it can happen a corner case where i_isze is over
      MAX_INLINE_SIZE while its inode is still inline_data.
      
      The scenario is
       1. write small data into file #A.
       2. fill the whole partition to 100%.
       3. truncate 4096 on file #A.
       4. write data at 8192 offset.
        --> f2fs_write_begin
          -> -ENOSPC = f2fs_convert_inline_page
          -> f2fs_write_failed
            -> truncate_blocks
              -> truncate_inline_inode
      	  BUG_ON, since i_size is 4096.
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      83e21db6
    • Chao Yu's avatar
      f2fs: fix to truncate inline data past EOF · 0bfcfcca
      Chao Yu authored
      
      
      Previously if inode is with inline data, we will try to invalid partial inline
      data in page #0 when we truncate size of inode in truncate_partial_data_page().
      And then we set page #0 to dirty, after this we can synchronize inode page with
      page #0 at ->writepage().
      
      But sometimes we will fail to operate page #0 in truncate_partial_data_page()
      due to below reason:
      a) if offset is zero, we will skip setting page #0 to dirty.
      b) if page #0 is not uptodate, we will fail to update it as it has no mapping
      data.
      
      So with following operations, we will meet recent data which should be
      truncated.
      
      1.write inline data to file
      2.sync first data page to inode page
      3.truncate file size to 0
      4.truncate file size to max_inline_size
      5.echo 1 > /proc/sys/vm/drop_caches
      6.read file --> meet original inline data which is remained in inode page.
      
      This patch renames truncate_inline_data() to truncate_inline_inode() for code
      readability, then use truncate_inline_inode() to truncate inline data in inode
      page in truncate_blocks() and truncate page #0 in truncate_partial_data_page()
      for fixing.
      
      v2:
       o truncate partially #0 page in truncate_partial_data_page to avoid keeping
         old data in #0 page.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      0bfcfcca
  3. 03 Mar, 2015 2 commits
  4. 12 Feb, 2015 1 commit
  5. 10 Jan, 2015 2 commits
  6. 26 Nov, 2014 2 commits
  7. 24 Nov, 2014 1 commit
  8. 19 Nov, 2014 1 commit
  9. 11 Nov, 2014 2 commits
  10. 05 Nov, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: revisit inline_data to avoid data races and potential bugs · b3d208f9
      Jaegeuk Kim authored
      
      
      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: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      b3d208f9
  11. 04 Nov, 2014 14 commits
  12. 07 Oct, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: support atomic writes · 88b88a66
      Jaegeuk Kim authored
      This patch introduces a very limited functionality for atomic write support.
      In order to support atomic write, this patch adds two ioctls:
       o F2FS_IOC_START_ATOMIC_WRITE
       o F2FS_IOC_COMMIT_ATOMIC_WRITE
      
      The database engine should be aware of the following sequence.
      1. open
       -> ioctl(F2FS_IOC_START_ATOMIC_WRITE);
      2. writes
        : all the written data will be treated as atomic pages.
      3. commit
       -> ioctl(F2FS_IOC_COMMIT_ATOMIC_WRITE);
        : this flushes all the data blocks to the disk, which will be shown all or
        nothing by f2fs recovery procedure.
      4. repeat to #2
      
      .
      
      The IO pattens should be:
      
        ,- START_ATOMIC_WRITE                  ,- COMMIT_ATOMIC_WRITE
       CP | D D D D D D | FSYNC | D D D D | FSYNC ...
                            `- COMMIT_ATOMIC_WRITE
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      88b88a66
  13. 09 Sep, 2014 1 commit
  14. 04 Sep, 2014 1 commit
  15. 21 Aug, 2014 2 commits
  16. 19 Aug, 2014 2 commits
  17. 29 Jul, 2014 1 commit