1. 09 8月, 2013 3 次提交
  2. 08 8月, 2013 1 次提交
    • J
      f2fs: fix a build failure due to missing the kobject header · c2d715d1
      Jaegeuk Kim 提交于
      This patch should resolve the following error reported by kbuild test robot.
      
      All error/warnings:
      
         In file included from fs/f2fs/dir.c:13:0:
         >> fs/f2fs/f2fs.h:435:17: error: field 's_kobj' has incomplete type
              struct kobject s_kobj;
      
      The failure was caused by missing the kobject header file in dir.c.
      So, this patch move the header file to the right location, f2fs.h.
      
      CC: Namjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      c2d715d1
  3. 06 8月, 2013 4 次提交
  4. 31 7月, 2013 1 次提交
  5. 30 7月, 2013 10 次提交
  6. 08 7月, 2013 1 次提交
    • J
      f2fs: fix readdir incorrectness · 99b072bb
      Jaegeuk Kim 提交于
      In the previous Al Viro's readdir patch set, there occurs a bug when
      running
      xfstest: 006 as follows.
      
      [Error output]
      alpha size = 4, name length = 6, total files = 4096, nproc=1
      1023 files created
      rm: cannot remove `/mnt/f2fs/permname.15150/a': Directory not empty
      
      [Correct output]
      alpha size = 4, name length = 6, total files = 4096, nproc=1
      4097 files created
      
      This bug is due to the misupdate of directory position in ctx.
      So, this patch fixes this.
      
      [AV: fixed a braino]
      
      CC: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      99b072bb
  7. 02 7月, 2013 7 次提交
    • J
      f2fs: fix to recover i_size from roll-forward · a1dd3c13
      Jaegeuk Kim 提交于
      If user requests many data writes and fsync together, the last updated i_size
      should be stored to the inode block consistently.
      
      But, previous write_end just marks the inode as dirty and doesn't update its
      metadata into its inode block.
      After that, fsync just writes the inode block with newly updated data index
      excluding inode metadata updates.
      
      So, this patch introduces write_end in which updates inode block too when the
      i_size is changed.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      a1dd3c13
    • G
      f2fs: remove the unused argument "sbi" of func destroy_fsync_dnodes() · 5ebefc5b
      Gu Zheng 提交于
      As destroy_fsync_dnodes() is a simple list-cleanup func, so delete the unused
      and unrelated f2fs_sb_info argument of it.
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      5ebefc5b
    • J
      f2fs: remove reusing any prefree segments · 763bfe1b
      Jaegeuk Kim 提交于
      This patch removes check_prefree_segments initially designed to enhance the
      performance by narrowing the range of LBA usage across the whole block device.
      
      When allocating a new segment, previous f2fs tries to find proper prefree
      segments, and then, if finds a segment, it reuses the segment for further
      data or node block allocation.
      
      However, I found that this was totally wrong approach since the prefree segments
      have several data or node blocks that will be used by the roll-forward mechanism
      operated after sudden-power-off.
      
      Let's assume the following scenario.
      
      /* write 8MB with fsync */
      for (i = 0; i < 2048; i++) {
      	offset = i * 4096;
      	write(fd, offset, 4KB);
      	fsync(fd);
      }
      
      In this case, naive segment allocation sequence will be like:
       data segment: x, x+1, x+2, x+3
       node segment: y, y+1, y+2, y+3.
      
      But, if we can reuse prefree segments, the sequence can be like:
       data segment: x, x+1, y, y+1
       node segment: y, y+1, y+2, y+3.
      Because, y, y+1, and y+2 became prefree segments one by one, and those are
      reused by data allocation.
      
      After conducting this workload, we should consider how to recover the latest
      inode with its data.
      If we reuse the prefree segments such as y or y+1, we lost the old node blocks
      so that f2fs even cannot start roll-forward recovery.
      
      Therefore, I suggest that we should remove reusing prefree segments.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      763bfe1b
    • G
      f2fs: code cleanup and simplify in func {find/add}_gc_inode · 6cc4af56
      Gu Zheng 提交于
      This patch simplifies list operations in find_gc_inode and add_gc_inode.
      Just simple code cleanup.
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      [Jaegeuk Kim: add description]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      6cc4af56
    • N
      f2fs: optimize the init_dirty_segmap function · 8736fbf0
      Namjae Jeon 提交于
      Optimize the while loop condition
      
      Since this condition will always be true and while loop will
      be terminated by the following condition in code:
      
      if (segno >= TOTAL_SEGS(sbi))
          break;
      Hence we can replace the while loop condition with while(1)
      instead of always checking for segno to be less than Total segs.
      
      Also we do not need to use TOTAL_SEGS() everytime. We can store
      this value in a local variable since this value is constant.
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NPankaj Kumar <pankaj.km@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      8736fbf0
    • J
      f2fs: fix an endian conversion bug detected by sparse · 060dd67b
      Jaegeuk Kim 提交于
      This patch should fix the following bug reported by kbuild test robot.
      
      fs/f2fs/recovery.c:233:33: sparse: incorrect type in assignment
      (different base types)
      
      parse warnings: (new ones prefixed by >>)
      
      >> recovery.c:233: sparse: incorrect type in assignment (different base types)
         recovery.c:233:    expected unsigned int [unsigned] [assigned] ofs_in_node
         recovery.c:233:    got restricted __le16 [assigned] [usertype] ofs_in_node
      >> recovery.c:238: sparse: incorrect type in assignment (different base types)
         recovery.c:238:    expected unsigned int [unsigned] ofs_in_node
         recovery.c:238:    got restricted __le16 [assigned] [usertype] ofs_in_node
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      060dd67b
    • J
      f2fs: fix crc endian conversion · 7e586fa0
      Jaegeuk Kim 提交于
      While calculating CRC for the checkpoint block, we use __u32, but when storing
      the crc value to the disk, we use __le32.
      
      Let's fix the inconsistency.
      Reported-and-Tested-by: NOded Gabbay <ogabbay@advaoptical.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      7e586fa0
  8. 29 6月, 2013 1 次提交
  9. 17 6月, 2013 1 次提交
    • N
      f2fs: add remount_fs callback support · 696c018c
      Namjae Jeon 提交于
      Add the f2fs_remount function call which will be used
      during the filesystem remounting. This function
      will help us to change the mount options specific to
      f2fs.
      
      Also modify the f2fs background_gc mount option, which
      will allow the user to dynamically trun on/off the
      garbage collection in f2fs based on the background_gc
      value. If background_gc=on, Garbage collection will
      be turned off & if background_gc=off, Garbage collection
      will be truned on.
      
      By default the garbage collection is on in f2fs.
      
      Change Log:
      v2: Incorporated the review comments by Gu Zheng.
          Removing the restore part for VFS flags
          Updating comments with proper flag conditions
          Display GC background option as ON/OFF
          Revised conditions to stop GC in case of remount
      
      v1: Initial changes for adding remount_fs callback
      support.
      
      Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NPankaj Kumar <pankaj.km@samsung.com>
      Reviewed-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      [Jaegeuk Kim: change /** with /* for the coding style]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      696c018c
  10. 14 6月, 2013 7 次提交
  11. 12 6月, 2013 1 次提交
    • J
      f2fs: sync dir->i_size with its block allocation · 699489bb
      Jaegeuk Kim 提交于
      If new dentry block is allocated and its i_size is updated, we should update
      its inode block together in order to sync i_size and its block allocation.
      Otherwise, we can loose additional dentry block due to the unconsistent i_size.
      
      Errorneous Scenario
      -------------------
      
      In the recovery routine,
       - recovery_dentry
       | - __f2fs_add_link
       | | - get_new_data_page
       | | | - i_size_write(new_i_size)
       | | | - mark_inode_dirty_sync(dir)
       | | - update_parent_metadata
       | | | - mark_inode_dirty(dir)
       |
       - write_checkpoint
         - sync_dirty_dir_inodes
           - filemap_flush(dentry_blocks)
             - f2fs_write_data_page
               - skip to write the last dentry block due to index < i_size
      
      In the above flow, new_i_size is not updated to its inode block so that the
      last dentry block will be lost accordingly.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      699489bb
  12. 11 6月, 2013 3 次提交