1. 11 4月, 2015 3 次提交
    • W
      f2fs: enable fast symlink by utilizing inline data · 368a0e40
      Wanpeng Li 提交于
      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: NWanpeng Li <wanpeng.li@linux.intel.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      368a0e40
    • J
      f2fs: avoid wrong f2fs_bug_on when truncating inline_data · 83e21db6
      Jaegeuk Kim 提交于
      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: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      83e21db6
    • C
      f2fs: fix to truncate inline data past EOF · 0bfcfcca
      Chao Yu 提交于
      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: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0bfcfcca
  2. 04 3月, 2015 2 次提交
  3. 12 2月, 2015 1 次提交
  4. 10 1月, 2015 2 次提交
  5. 26 11月, 2014 2 次提交
  6. 24 11月, 2014 1 次提交
  7. 19 11月, 2014 1 次提交
  8. 12 11月, 2014 1 次提交
    • J
      f2fs: convert inline_data when i_size becomes large · 92dffd01
      Jaegeuk Kim 提交于
      If i_size becomes large outside of MAX_INLINE_DATA, we shoud convert the inode.
      Otherwise, we can make some dirty pages during the truncation, and those pages
      will be written through f2fs_write_data_page.
      At that moment, the inode has still inline_data, so that it tries to write non-
      zero pages into inline_data area.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      92dffd01
  9. 11 11月, 2014 1 次提交
  10. 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
  11. 04 11月, 2014 14 次提交
  12. 07 10月, 2014 1 次提交
    • J
      f2fs: support atomic writes · 88b88a66
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk@kernel.org>
      88b88a66
  13. 10 9月, 2014 1 次提交
  14. 04 9月, 2014 1 次提交
  15. 22 8月, 2014 2 次提交
  16. 20 8月, 2014 2 次提交
  17. 29 7月, 2014 1 次提交
  18. 07 5月, 2014 3 次提交