1. 03 6月, 2016 17 次提交
  2. 28 5月, 2016 1 次提交
  3. 21 5月, 2016 4 次提交
    • A
      lib/uuid.c: move generate_random_uuid() to uuid.c · 8da4b8c4
      Andy Shevchenko 提交于
      Let's gather the UUID related functions under one hood.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8da4b8c4
    • C
      f2fs: fix to update dirty page count correctly · 0f3311a8
      Chao Yu 提交于
      Once we failed to merge inline data into inode page during flushing inline
      inode, we will skip invoking inode_dec_dirty_pages, which makes dirty page
      count incorrect, result in panic in ->evict_inode, Fix it.
      
      ------------[ cut here ]------------
      kernel BUG at /home/yuchao/git/devf2fs/inode.c:336!
      invalid opcode: 0000 [#1] PREEMPT SMP
      CPU: 3 PID: 10004 Comm: umount Tainted: G           O    4.6.0-rc5+ #17
      Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      task: f0c33000 ti: c5212000 task.ti: c5212000
      EIP: 0060:[<f89aacb5>] EFLAGS: 00010202 CPU: 3
      EIP is at f2fs_evict_inode+0x85/0x490 [f2fs]
      EAX: 00000001 EBX: c4529ea0 ECX: 00000001 EDX: 00000000
      ESI: c0131000 EDI: f89dd0a0 EBP: c5213e9c ESP: c5213e78
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      CR0: 80050033 CR2: b75878c0 CR3: 1a36a700 CR4: 000406f0
      Stack:
       c4529ea0 c4529ef4 c5213e8c c176d45c c4529ef4 00000000 c4529ea0 c4529fac
       f89dd0a0 c5213eb0 c1204a68 c5213ed8 c452a2b4 c6680930 c5213ec0 c1204b64
       c6680d44 c6680620 c5213eec c120588d ee84b000 ee84b5c0 c5214000 ee84b5e0
      Call Trace:
       [<c176d45c>] ? _raw_spin_unlock+0x2c/0x50
       [<c1204a68>] evict+0xa8/0x170
       [<c1204b64>] dispose_list+0x34/0x50
       [<c120588d>] evict_inodes+0x10d/0x130
       [<c11ea941>] generic_shutdown_super+0x41/0xe0
       [<c1185190>] ? unregister_shrinker+0x40/0x50
       [<c1185190>] ? unregister_shrinker+0x40/0x50
       [<c11eac52>] kill_block_super+0x22/0x70
       [<f89af23e>] kill_f2fs_super+0x1e/0x20 [f2fs]
       [<c11eae1d>] deactivate_locked_super+0x3d/0x70
       [<c11eb383>] deactivate_super+0x43/0x60
       [<c1208ec9>] cleanup_mnt+0x39/0x80
       [<c1208f50>] __cleanup_mnt+0x10/0x20
       [<c107d091>] task_work_run+0x71/0x90
       [<c105725a>] exit_to_usermode_loop+0x72/0x9e
       [<c1001c7c>] do_fast_syscall_32+0x19c/0x1c0
       [<c176dd48>] sysenter_past_esp+0x45/0x74
      EIP: [<f89aacb5>] f2fs_evict_inode+0x85/0x490 [f2fs] SS:ESP 0068:c5213e78
      ---[ end trace d30536330b7fdc58 ]---
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0f3311a8
    • J
      f2fs: flush pending bios right away when error occurs · 38f91ca8
      Jaegeuk Kim 提交于
      Given errors, this patch flushes pending bios as soon as possible.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      38f91ca8
    • J
      f2fs: avoid ENOSPC fault in the recovery process · 975756c4
      Jaegeuk Kim 提交于
      This patch avoids impossible error injection, ENOSPC, during recovery process.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      975756c4
  4. 19 5月, 2016 6 次提交
  5. 17 5月, 2016 6 次提交
  6. 12 5月, 2016 6 次提交
    • C
      f2fs: fix deadlock when flush inline data · ab47036d
      Chao Yu 提交于
      Below backtrace info was reported by Yunlei He:
      
      Call Trace:
       [<ffffffff817a9395>] schedule+0x35/0x80
       [<ffffffff817abb7d>] rwsem_down_read_failed+0xed/0x130
       [<ffffffff813c12a8>] call_rwsem_down_read_failed+0x18/0x
       [<ffffffff817ab1d0>] down_read+0x20/0x30
       [<ffffffffa02a1a12>] f2fs_evict_inode+0x242/0x3a0 [f2fs]
       [<ffffffff81217057>] evict+0xc7/0x1a0
       [<ffffffff81217cd6>] iput+0x196/0x200
       [<ffffffff812134f9>] __dentry_kill+0x179/0x1e0
       [<ffffffff812136f9>] dput+0x199/0x1f0
       [<ffffffff811fe77b>] __fput+0x18b/0x220
       [<ffffffff811fe84e>] ____fput+0xe/0x10
       [<ffffffff81097427>] task_work_run+0x77/0x90
       [<ffffffff81074d62>] exit_to_usermode_loop+0x73/0xa2
       [<ffffffff81003b7a>] do_syscall_64+0xfa/0x110
       [<ffffffff817acf65>] entry_SYSCALL64_slow_path+0x25/0x25
      
      Call Trace:
       [<ffffffff817a9395>] schedule+0x35/0x80
       [<ffffffff81216dc3>] __wait_on_freeing_inode+0xa3/0xd0
       [<ffffffff810bc300>] ? autoremove_wake_function+0x40/0x4
       [<ffffffff8121771d>] find_inode_fast+0x7d/0xb0
       [<ffffffff8121794a>] ilookup+0x6a/0xd0
       [<ffffffffa02bc740>] sync_node_pages+0x210/0x650 [f2fs]
       [<ffffffff8122e690>] ? do_fsync+0x70/0x70
       [<ffffffffa02b085e>] block_operations+0x9e/0xf0 [f2fs]
       [<ffffffff8137b795>] ? bio_endio+0x55/0x60
       [<ffffffffa02b0942>] write_checkpoint+0x92/0xba0 [f2fs]
       [<ffffffff8117da57>] ? mempool_free_slab+0x17/0x20
       [<ffffffff8117de8b>] ? mempool_free+0x2b/0x80
       [<ffffffff8122e690>] ? do_fsync+0x70/0x70
       [<ffffffffa02a53e3>] f2fs_sync_fs+0x63/0xd0 [f2fs]
       [<ffffffff8129630f>] ? ext4_sync_fs+0xbf/0x190
       [<ffffffff8122e6b0>] sync_fs_one_sb+0x20/0x30
       [<ffffffff812002e9>] iterate_supers+0xb9/0x110
       [<ffffffff8122e7b5>] sys_sync+0x55/0x90
       [<ffffffff81003ae9>] do_syscall_64+0x69/0x110
       [<ffffffff817acf65>] entry_SYSCALL64_slow_path+0x25/0x25
      
      With following excuting serials, we will set inline_node in inode page
      after inode was unlinked, result in a deadloop described as below:
      1. open file
      2. write file
      3. unlink file
      4. write file
      5. close file
      
      Thread A				Thread B
       - dput
        - iput_final
         - inode->i_state |= I_FREEING
         - evict
          - f2fs_evict_inode
      					 - f2fs_sync_fs
      					  - write_checkpoint
      					   - block_operations
      					    - f2fs_lock_all (down_write(cp_rwsem))
           - f2fs_lock_op (down_read(cp_rwsem))
      					    - sync_node_pages
      					     - ilookup
      					      - find_inode_fast
      					       - __wait_on_freeing_inode
      					         (wait on I_FREEING clear)
      
      Here, we change to set inline_node flag only for linked inode for fixing.
      Reported-by: NYunlei He <heyunlei@huawei.com>
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Tested-by: NJaegeuk Kim <jaegeuk@kernel.org>
      Cc: stable@vger.kernel.org # v4.6
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ab47036d
    • J
      f2fs: avoid f2fs_bug_on during recovery · 3b9b10f9
      Jaegeuk Kim 提交于
      We don't need to use f2fs_bug_on() to treat with any error case when allocating
      a block during recovery.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3b9b10f9
    • J
      f2fs: show # of orphan inodes · 652be551
      Jaegeuk Kim 提交于
      This adds debug information for # of orphan inodes.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      652be551
    • C
      f2fs: support in batch fzero in dnode page · 6e961949
      Chao Yu 提交于
      This patch tries to speedup fzero_range by making space preallocation and
      address removal of blocks in one dnode page as in batch operation.
      
      In virtual machine, with zram driver:
      
      dd if=/dev/zero of=/mnt/f2fs/file bs=1M count=4096
      time xfs_io -f /mnt/f2fs/file -c "fzero 0 4096M"
      
      Before:
      real	0m3.276s
      user	0m0.008s
      sys	0m3.260s
      
      After:
      real	0m1.568s
      user	0m0.000s
      sys	0m1.564s
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: consider ENOSPC case]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6e961949
    • C
      f2fs: support in batch multi blocks preallocation · 46008c6d
      Chao Yu 提交于
      This patch introduces reserve_new_blocks to make preallocation of multi
      blocks as in batch operation, so it can avoid lots of redundant
      operation, result in better performance.
      
      In virtual machine, with rotational device:
      
      time fallocate -l 32G /mnt/f2fs/file
      
      Before:
      real	0m4.584s
      user	0m0.000s
      sys	0m4.580s
      
      After:
      real	0m0.292s
      user	0m0.000s
      sys	0m0.272s
      
      In x86, with SSD:
      
      time fallocate -l 500G $MNT/testfile
      
      Before : 24.758 s
      After  :  1.604 s
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: fix bugs and add performance numbers measured in x86.]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      46008c6d
    • C
      f2fs: make atomic/volatile operation exclusive · 0fac558b
      Chao Yu 提交于
      atomic/volatile ioctl interfaces are exposed to user like other file
      operation interface, it needs to make them getting exclusion against
      to each other to avoid potential conflict among these operations
      in concurrent scenario.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0fac558b