1. 11 Nov, 2014 2 commits
  2. 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
  3. 04 Nov, 2014 14 commits
  4. 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
  5. 09 Sep, 2014 1 commit
  6. 04 Sep, 2014 1 commit
  7. 21 Aug, 2014 2 commits
  8. 19 Aug, 2014 2 commits
  9. 29 Jul, 2014 1 commit
  10. 07 May, 2014 4 commits
  11. 02 Apr, 2014 1 commit
  12. 14 Jan, 2014 1 commit
  13. 06 Jan, 2014 6 commits
    • Chao Yu's avatar
      f2fs: avoid to read inline data except first page · 04a17fb1
      Chao Yu authored
      
      
      Here is a case which could read inline page data not from first page.
      
      1. write inline data
      2. lseek to offset 4096
      3. read 4096 bytes from offset 4096
      	(read_inline_data read inline data page to non-first page,
      	And previously VFS has add this page to page cache)
      4. ftruncate offset 8192
      5. read 4096 bytes from offset 4096
      	(we meet this updated page with inline data in cache)
      
      So we should leave this page with inited data and uptodate flag
      for this case.
      
      Change log from v1:
       o fix a deadlock bug
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      04a17fb1
    • Chao Yu's avatar
      f2fs: avoid to left uninitialized data in page when read inline data · 18309aaa
      Chao Yu authored
      
      
      Change log from v1:
       o reduce unneeded memset in __f2fs_convert_inline_data
      
      >From 58796be2bd2becbe8d52305210fb2a64e7dd80b6 Mon Sep 17 00:00:00 2001
      From: Chao Yu <chao2.yu@samsung.com>
      Date: Mon, 30 Dec 2013 09:21:33 +0800
      Subject: [PATCH] f2fs: avoid to left uninitialized data in page when read
       inline data
      
      We left uninitialized data in the tail of page when we read an inline data
      page. So let's initialize left part of the page excluding inline data region.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      18309aaa
    • Jaegeuk Kim's avatar
      f2fs: handle errors correctly during f2fs_reserve_block · a8865372
      Jaegeuk Kim authored
      
      
      The get_dnode_of_data nullifies inode and node page when error is occurred.
      
      There are two cases that passes inode page into get_dnode_of_data().
      
      1. make_empty_dir()
          -> get_new_data_page()
            -> f2fs_reserve_block(ipage)
      	-> get_dnode_of_data()
      
      2. f2fs_convert_inline_data()
          -> __f2fs_convert_inline_data()
            -> f2fs_reserve_block(ipage)
      	-> get_dnode_of_data()
      
      This patch adds correct error handling codes when get_dnode_of_data() returns
      an error.
      
      At first, f2fs_reserve_block() calls f2fs_put_dnode() whenever reserve_new_block
      returns an error.
      So, the rule of f2fs_reserve_block() is to nullify inode page when there is any
      error internally.
      
      Finally, two callers of f2fs_reserve_block() should call f2fs_put_dnode()
      appropriately if they got an error since successful f2fs_reserve_block().
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      a8865372
    • Jaegeuk Kim's avatar
      f2fs: add inline_data recovery routine · 1e1bb4ba
      Jaegeuk Kim authored
      
      
      This patch adds a inline_data recovery routine with the following policy.
      
      [prev.] [next] of inline_data flag
         o       o  -> recover inline_data
         o       x  -> remove inline_data, and then recover data blocks
         x       o  -> remove inline_data, and then recover inline_data
         x       x  -> recover data blocks
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      1e1bb4ba
    • Jaegeuk Kim's avatar
      f2fs: add the number of inline_data files to status info · 0dbdc2ae
      Jaegeuk Kim authored
      
      
      This patch adds the number of inline_data files into the status information.
      Note that the number is reset whenever the filesystem is newly mounted.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      0dbdc2ae
    • Jaegeuk Kim's avatar
      f2fs: refactor f2fs_convert_inline_data · 9e09fc85
      Jaegeuk Kim authored
      
      
      Change log from v1:
       o handle NULL pointer of grab_cache_page_write_begin() pointed by Chao Yu.
      
      This patch refactors f2fs_convert_inline_data to check a couple of conditions
      internally for deciding whether it needs to convert inline_data or not.
      
      So, the new f2fs_convert_inline_data initially checks:
      1) f2fs_has_inline_data(), and
      2) the data size to be changed.
      
      If the inode has inline_data but the size to fill is less than MAX_INLINE_DATA,
      then we don't need to convert the inline_data with data allocation.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      9e09fc85
  14. 26 Dec, 2013 1 commit