1. 25 7月, 2014 1 次提交
  2. 10 7月, 2014 2 次提交
  3. 23 6月, 2014 1 次提交
  4. 08 6月, 2014 1 次提交
  5. 04 6月, 2014 1 次提交
  6. 07 5月, 2014 15 次提交
  7. 02 4月, 2014 1 次提交
  8. 01 4月, 2014 1 次提交
  9. 18 3月, 2014 3 次提交
  10. 28 2月, 2014 1 次提交
    • C
      f2fs: fix dirty page accounting when redirty · 9cf3c389
      Chao Yu 提交于
      We should de-account dirty counters for page when redirty in ->writepage().
      
      Wu Fengguang described in 'commit 971767ca':
      "writeback: fix dirtied pages accounting on redirty
      De-account the accumulative dirty counters on page redirty.
      
      Page redirties (very common in ext4) will introduce mismatch between
      counters (a) and (b)
      
      a) NR_DIRTIED, BDI_DIRTIED, tsk->nr_dirtied
      b) NR_WRITTEN, BDI_WRITTEN
      
      This will introduce systematic errors in balanced_rate and result in
      dirty page position errors (ie. the dirty pages are no longer balanced
      around the global/bdi setpoints)."
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      9cf3c389
  11. 24 2月, 2014 1 次提交
    • J
      f2fs: fix not to write data pages on the page reclaiming path · 8618b881
      Jaegeuk Kim 提交于
      Even if f2fs_write_data_page is called by the page reclaiming path, we should
      not write the page to provide enough free segments for the worst case scenario.
      Otherwise, f2fs can face with no free segment while gc is conducted, resulting
      in:
      
       ------------[ cut here ]------------
       kernel BUG at /home/zeus/f2fs_test/src/fs/f2fs/segment.c:565!
       RIP: 0010:[<ffffffffa02c3b11>]  [<ffffffffa02c3b11>] new_curseg+0x331/0x340 [f2fs]
       Call Trace:
        allocate_segment_by_default+0x204/0x280 [f2fs]
        allocate_data_block+0x108/0x210 [f2fs]
        write_data_page+0x8a/0xc0 [f2fs]
        do_write_data_page+0xe1/0x2a0 [f2fs]
        move_data_page+0x8a/0xf0 [f2fs]
        f2fs_gc+0x446/0x970 [f2fs]
        f2fs_balance_fs+0xb6/0xd0 [f2fs]
        f2fs_write_begin+0x50/0x350 [f2fs]
        ? unlock_page+0x27/0x30
        ? unlock_page+0x27/0x30
        generic_file_buffered_write+0x10a/0x280
        ? file_update_time+0xa3/0xf0
        __generic_file_aio_write+0x1c8/0x3d0
        ? generic_file_aio_write+0x52/0xb0
        ? generic_file_aio_write+0x52/0xb0
        generic_file_aio_write+0x65/0xb0
        do_sync_write+0x5a/0x90
        vfs_write+0xc5/0x1f0
        SyS_write+0x55/0xa0
        system_call_fastpath+0x16/0x1b
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      8618b881
  12. 17 2月, 2014 3 次提交
  13. 22 1月, 2014 1 次提交
  14. 20 1月, 2014 1 次提交
  15. 16 1月, 2014 2 次提交
    • C
      f2fs: missing REQ_META and REQ_PRIO when sync_meta_pages(META_FLUSH) · c434cbc0
      Changman Lee 提交于
      Doing sync_meta_pages with META_FLUSH when checkpoint, we overide rw
      using WRITE_FLUSH_FUA. At this time, we also should set
      REQ_META|REQ_PRIO.
      Signed-off-by: NChangman Lee <cm224.lee@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      c434cbc0
    • J
      f2fs: avoid f2fs_balance_fs call during pageout · c33ec326
      Jaegeuk Kim 提交于
      This patch should resolve the following bug.
      
      =========================================================
      [ INFO: possible irq lock inversion dependency detected ]
      3.13.0-rc5.f2fs+ #6 Not tainted
      ---------------------------------------------------------
      kswapd0/41 just changed the state of lock:
       (&sbi->gc_mutex){+.+.-.}, at: [<ffffffffa030503e>] f2fs_balance_fs+0xae/0xd0 [f2fs]
      but this lock took another, RECLAIM_FS-READ-unsafe lock in the past:
       (&sbi->cp_rwsem){++++.?}
      
      and interrupts could create inverse lock ordering between them.
      
      other info that might help us debug this:
      Chain exists of:
        &sbi->gc_mutex --> &sbi->cp_mutex --> &sbi->cp_rwsem
      
       Possible interrupt unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock(&sbi->cp_rwsem);
                                     local_irq_disable();
                                     lock(&sbi->gc_mutex);
                                     lock(&sbi->cp_mutex);
        <Interrupt>
          lock(&sbi->gc_mutex);
      
       *** DEADLOCK ***
      
      This bug is due to the f2fs_balance_fs call in f2fs_write_data_page.
      If f2fs_write_data_page is triggered by wbc->for_reclaim via kswapd, it should
      not call f2fs_balance_fs which tries to get a mutex grabbed by original syscall
      flow.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      c33ec326
  16. 14 1月, 2014 1 次提交
  17. 06 1月, 2014 3 次提交
    • J
      f2fs: handle errors correctly during f2fs_reserve_block · a8865372
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      a8865372
    • J
      f2fs: refactor f2fs_convert_inline_data · 9e09fc85
      Jaegeuk Kim 提交于
      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: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      9e09fc85
    • J
      f2fs: call f2fs_put_page at the error case · 26f466f4
      Jaegeuk Kim 提交于
      In f2fs_write_begin(), if f2fs_conver_inline_data() returns an error like
      -ENOSPC, f2fs should call f2fs_put_page().
      Otherwise, it is remained as a locked page, resulting in the following bug.
      
      [<ffffffff8114657e>] sleep_on_page+0xe/0x20
      [<ffffffff81146567>] __lock_page+0x67/0x70
      [<ffffffff81157d08>] truncate_inode_pages_range+0x368/0x5d0
      [<ffffffff81157ff5>] truncate_inode_pages+0x15/0x20
      [<ffffffff8115804b>] truncate_pagecache+0x4b/0x70
      [<ffffffff81158082>] truncate_setsize+0x12/0x20
      [<ffffffffa02a1842>] f2fs_setattr+0x72/0x270 [f2fs]
      [<ffffffff811cdae3>] notify_change+0x213/0x400
      [<ffffffff811ab376>] do_truncate+0x66/0xa0
      [<ffffffff811ab541>] vfs_truncate+0x191/0x1b0
      [<ffffffff811ab5bc>] do_sys_truncate+0x5c/0xa0
      [<ffffffff811ab78e>] SyS_truncate+0xe/0x10
      [<ffffffff81756052>] system_call_fastpath+0x16/0x1b
      [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      26f466f4
  18. 26 12月, 2013 1 次提交
    • H
      f2fs: handle inline data operations · 9ffe0fb5
      Huajun Li 提交于
      Hook inline data read/write, truncate, fallocate, setattr, etc.
      
      Files need meet following 2 requirement to inline:
       1) file size is not greater than MAX_INLINE_DATA;
       2) file doesn't pre-allocate data blocks by fallocate().
      
      FI_INLINE_DATA will not be set while creating a new regular inode because
      most of the files are bigger than ~3.4K. Set FI_INLINE_DATA only when
      data is submitted to block layer, ranther than set it while creating a new
      inode, this also avoids converting data from inline to normal data block
      and vice versa.
      
      While writting inline data to inode block, the first data block should be
      released if the file has a block indexed by i_addr[0].
      
      On the other hand, when a file operation is appied to a file with inline
      data, we need to test if this file can remain inline by doing this
      operation, otherwise it should be convert into normal file by reserving
      a new data block, copying inline data to this new block and clear
      FI_INLINE_DATA flag. Because reserve a new data block here will make use
      of i_addr[0], if we save inline data in i_addr[0..872], then the first
      4 bytes would be overwriten. This problem can be avoided simply by
      not using i_addr[0] for inline data.
      Signed-off-by: NHuajun Li <huajun.li@intel.com>
      Signed-off-by: NHaicheng Li <haicheng.li@linux.intel.com>
      Signed-off-by: NWeihong Xu <weihong.xu@intel.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      9ffe0fb5