1. 12 2月, 2015 5 次提交
    • J
      f2fs: split UMOUNT and FASTBOOT flags · 119ee914
      Jaegeuk Kim 提交于
      This patch adds FASTBOOT flag into checkpoint as follows.
      
       - CP_UMOUNT_FLAG is set when system is umounted.
       - CP_FASTBOOT_FLAG is set when intermediate checkpoint having node summaries
         was done.
      
      So, if you get CP_UMOUNT_FLAG from checkpoint, the system was umounted cleanly.
      Instead, if there was sudden-power-off, you can get CP_FASTBOOT_FLAG or nothing.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      119ee914
    • J
      f2fs: avoid write_checkpoint if f2fs is mounted readonly · 11504a8e
      Jaegeuk Kim 提交于
      Do not change any partition when f2fs is changed to readonly mode.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      11504a8e
    • C
      f2fs: merge flags in struct f2fs_sb_info · caf0047e
      Chao Yu 提交于
      Currently, there are several variables with Boolean type as below:
      
      struct f2fs_sb_info {
      ...
      	int s_dirty;
      	bool need_fsck;
      	bool s_closing;
      ...
      	bool por_doing;
      ...
      }
      
      For this there are some issues:
      1. there are some space of f2fs_sb_info is wasted due to aligning after Boolean
         type variables by compiler.
      2. if we continuously add new flag into f2fs_sb_info, structure will be messed
         up.
      
      So in this patch, we try to:
      1. switch s_dirty to Boolean type variable since it has two status 0/1.
      2. merge s_dirty/need_fsck/s_closing/por_doing variables into s_flag.
      3. introduce an enum type which can indicate different states of sbi.
      4. use new introduced universal interfaces is_sbi_flag_set/{set,clear}_sbi_flag
         to operate flags for sbi.
      
      After that, above issues will be fixed.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      caf0047e
    • C
      f2fs: fix to release count of meta page in ->invalidatepage · 1601839e
      Chao Yu 提交于
      We will encounter deadloop in below scenario:
      
      1. increase page count for F2FS_DIRTY_META type in following path:
      ->recover_fsync_data
        ->recover_data
          ->do_recover_data
            ->recover_data_page
              ->change_curseg
                ->write_sum_page
                  ->set_page_dirty
      2. fail in recover_data()
      3. invalidate meta pages in truncate_inode_pages_final without decreasing page
         count.
      4. deadloop when sync_meta_pages as page count will always be non-zero.
      
      message:
      NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s!
      
       [<c1129a37>] pagevec_lookup_tag+0x27/0x30
       [<f0e774c7>] sync_meta_pages+0x87/0x160 [f2fs]
       [<f0e86dd9>] recover_fsync_data+0xeb9/0xf10 [f2fs]
       [<f0e75398>] f2fs_fill_super+0x888/0x980 [f2fs]
       [<c11733ca>] mount_bdev+0x16a/0x1a0
       [<f0e7180f>] f2fs_mount+0x1f/0x30 [f2fs]
       [<c1173da6>] mount_fs+0x36/0x170
       [<c118b6f5>] vfs_kern_mount+0x55/0xe0
       [<c118d63f>] do_mount+0x1df/0x9f0
       [<c118e110>] SyS_mount+0x70/0xb0
       [<c15a0c48>] sysenter_do_call+0x12/0x12
      
      To avoid page count leak, let's add ->invalidatepage and ->releasepage in
      f2fs_meta_aops as f2fs_node_aops to release meta page count correctly.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1601839e
    • J
      f2fs: do checkpoint when umount flag is not set · 85dc2f2c
      Jaegeuk Kim 提交于
      If the previous checkpoint was done without CP_UMOUNT flag, it needs to do
      checkpoint with CP_UMOUNT for the next fast boot.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      85dc2f2c
  2. 10 1月, 2015 4 次提交
  3. 09 12月, 2014 3 次提交
  4. 06 12月, 2014 1 次提交
    • J
      f2fs: call radix_tree_preload before radix_tree_insert · 769ec6e5
      Jaegeuk Kim 提交于
      This patch tries to fix:
      
       BUG: using smp_processor_id() in preemptible [00000000] code: f2fs_gc-254:0/384
        (radix_tree_node_alloc+0x14/0x74) from [<c033d8a0>] (radix_tree_insert+0x110/0x200)
        (radix_tree_insert+0x110/0x200) from [<c02e8264>] (gc_data_segment+0x340/0x52c)
        (gc_data_segment+0x340/0x52c) from [<c02e8658>] (f2fs_gc+0x208/0x400)
        (f2fs_gc+0x208/0x400) from [<c02e8a98>] (gc_thread_func+0x248/0x28c)
        (gc_thread_func+0x248/0x28c) from [<c0139944>] (kthread+0xa0/0xac)
        (kthread+0xa0/0xac) from [<c0105ef8>] (ret_from_fork+0x14/0x3c)
      
      The reason is that f2fs calls radix_tree_insert under enabled preemption.
      So, before calling it, we need to call radix_tree_preload.
      
      Otherwise, we should use _GFP_WAIT for the radix tree, and use mutex or
      semaphore to cover the radix tree operations.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      769ec6e5
  5. 20 11月, 2014 2 次提交
    • J
      f2fs: write SSA pages under memory pressure · 857dc4e0
      Jaegeuk Kim 提交于
      Under memory pressure, we don't need to skip SSA page writes.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      857dc4e0
    • C
      f2fs: introduce struct inode_management to wrap inner fields · 67298804
      Chao Yu 提交于
      Now in f2fs, we have three inode cache: ORPHAN_INO, APPEND_INO, UPDATE_INO,
      and we manage fields related to inode cache separately in struct f2fs_sb_info
      for each inode cache type.
      This makes codes a bit messy, so that this patch intorduce a new struct
      inode_management to wrap inner fields as following which make codes more neat.
      
      /* for inner inode cache management */
      struct inode_management {
      	struct radix_tree_root ino_root;	/* ino entry array */
      	spinlock_t ino_lock;			/* for ino entry lock */
      	struct list_head ino_list;		/* inode list head */
      	unsigned long ino_num;			/* number of entries */
      };
      
      struct f2fs_sb_info {
      	...
      	struct inode_management im[MAX_INO_ENTRY];      /* manage inode cache */
      	...
      }
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      67298804
  6. 07 11月, 2014 1 次提交
  7. 05 11月, 2014 1 次提交
    • J
      f2fs: avoid race condition in handling wait_io · 6a8f8ca5
      Jaegeuk Kim 提交于
      __submit_merged_bio    f2fs_write_end_io        f2fs_write_end_io
                             wait_io = X              wait_io = x
                             complete(X)              complete(X)
                             wait_io = NULL
      wait_for_completion()
      free(X)
                                                       spin_lock(X)
                                                       kernel panic
      
      In order to avoid this, this patch removes the wait_io facility.
      Instead, we can use wait_on_all_pages_writeback(sbi) to wait for end_ios.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6a8f8ca5
  8. 04 11月, 2014 1 次提交
  9. 01 10月, 2014 3 次提交
  10. 24 9月, 2014 2 次提交
  11. 16 9月, 2014 2 次提交
  12. 10 9月, 2014 2 次提交
  13. 04 9月, 2014 1 次提交
  14. 23 8月, 2014 1 次提交
  15. 22 8月, 2014 4 次提交
  16. 20 8月, 2014 1 次提交
  17. 31 7月, 2014 3 次提交
  18. 29 7月, 2014 3 次提交