1. 01 10月, 2016 17 次提交
  2. 23 9月, 2016 5 次提交
  3. 16 9月, 2016 1 次提交
  4. 15 9月, 2016 2 次提交
  5. 14 9月, 2016 4 次提交
  6. 13 9月, 2016 4 次提交
  7. 08 9月, 2016 7 次提交
    • J
      f2fs: no need to make zeros beyond i_size · 68f31393
      Jaegeuk Kim 提交于
      We don't need to make zeros beyond i_size, since we already wrote that through
      NEW_ADDR case.
      Reported-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      68f31393
    • C
      f2fs: fix to detect temporary name of multimedia file · 7732c26a
      Chao Yu 提交于
      Some applications may create multimeida file with temporary name like
      '*.jpg.tmp' or '*.mp4.tmp', then rename to '*.jpg' or '*.mp4'.
      
      Now, f2fs can only detect multimedia filename with specified format:
      "filename + '.' + extension", so it will make f2fs missing to detect
      multimedia file with special temporary name, result in failing to set
      cold flag on file.
      
      This patch enhances detection flow for enabling lookup extension in the
      middle of temporary filename.
      Reported-by: NXue Liu <liuxueliu.liu@huawei.com>
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7732c26a
    • C
      f2fs: fix minor typo · 6ab2a308
      Chao Yu 提交于
      Correct typo from 'destory' to 'destroy'.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6ab2a308
    • J
      f2fs: set dentry bits on random location in memory · 6bf6b267
      Jaegeuk Kim 提交于
      This fixes pointer panic when using inline_dentry, which was triggered when
      backporting to 3.10.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6bf6b267
    • C
      f2fs: fix to set superblock dirty correctly · c2a080ae
      Chao Yu 提交于
      tests/generic/251 of fstest suit complains us with below message:
      
      ------------[ cut here ]------------
      invalid opcode: 0000 [#1] PREEMPT SMP
      CPU: 2 PID: 7698 Comm: fstrim Tainted: G           O    4.7.0+ #21
      task: e9f4e000 task.stack: e7262000
      EIP: 0060:[<f89fcefe>] EFLAGS: 00010202 CPU: 2
      EIP is at write_checkpoint+0xfde/0x1020 [f2fs]
      EAX: f33eb300 EBX: eecac310 ECX: 00000001 EDX: ffff0001
      ESI: eecac000 EDI: eecac5f0 EBP: e7263dec ESP: e7263d18
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      CR0: 80050033 CR2: b76ab01c CR3: 2eb89de0 CR4: 000406f0
      Stack:
       00000001 a220fb7b e9f4e000 00000002 419ff2d3 b3a05151 00000002 e9f4e5d8
       e9f4e000 419ff2d3 b3a05151 eecac310 c10b8154 b3a05151 419ff2d3 c10b78bd
       e9f4e000 e9f4e000 e9f4e5d8 00000001 e9f4e000 ec409000 eecac2cc eecac288
      Call Trace:
       [<c10b8154>] ? __lock_acquire+0x3c4/0x760
       [<c10b78bd>] ? mark_held_locks+0x5d/0x80
       [<f8a10632>] f2fs_trim_fs+0x1c2/0x2e0 [f2fs]
       [<f89e9f56>] f2fs_ioctl+0x6b6/0x10b0 [f2fs]
       [<c13d51df>] ? __this_cpu_preempt_check+0xf/0x20
       [<c10b4281>] ? trace_hardirqs_off_caller+0x91/0x120
       [<f89e98a0>] ? __exchange_data_block+0xd30/0xd30 [f2fs]
       [<c120b2e1>] do_vfs_ioctl+0x81/0x7f0
       [<c11d57c5>] ? kmem_cache_free+0x245/0x2e0
       [<c1217840>] ? get_unused_fd_flags+0x40/0x40
       [<c1206eec>] ? putname+0x4c/0x50
       [<c11f631e>] ? do_sys_open+0x16e/0x1d0
       [<c1001990>] ? do_fast_syscall_32+0x30/0x1c0
       [<c13d51df>] ? __this_cpu_preempt_check+0xf/0x20
       [<c120baa8>] SyS_ioctl+0x58/0x80
       [<c1001a01>] do_fast_syscall_32+0xa1/0x1c0
       [<c178cc54>] sysenter_past_esp+0x45/0x74
      EIP: [<f89fcefe>] write_checkpoint+0xfde/0x1020 [f2fs] SS:ESP 0068:e7263d18
      ---[ end trace 4de95d7e6b3aa7c6 ]---
      
      The reason is: with below call stack, we will encounter BUG_ON during
      doing fstrim.
      
      Thread A				Thread B
      - write_checkpoint
       - do_checkpoint
      					- f2fs_write_inode
      					 - update_inode_page
      					  - update_inode
      					   - set_page_dirty
      					    - f2fs_set_node_page_dirty
      					     - inc_page_count
      					      - percpu_counter_inc
      					      - set_sbi_flag(SBI_IS_DIRTY)
        - clear_sbi_flag(SBI_IS_DIRTY)
      
      Thread C				Thread D
      - f2fs_write_node_page
       - set_node_addr
        - __set_nat_cache_dirty
         - nm_i->dirty_nat_cnt++
      					- do_vfs_ioctl
      					 - f2fs_ioctl
      					  - f2fs_trim_fs
      					   - write_checkpoint
      					    - f2fs_bug_on(nm_i->dirty_nat_cnt)
      
      Fix it by setting superblock dirty correctly in do_checkpoint and
      f2fs_write_node_page.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      c2a080ae
    • S
      f2fs: add roll-forward recovery process for encrypted dentry · e7ba108a
      Shuoran Liu 提交于
      Add roll-forward recovery process for encrypted dentry, so the first fsync
      issued to an encrypted file does not need writing checkpoint.
      
      This improves the performance of the following test at thousands of small
      files: open -> write -> fsync -> close
      Signed-off-by: NShuoran Liu <liushuoran@huawei.com>
      Acked-by: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: modify kernel message to show encrypted names]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e7ba108a
    • J
      f2fs: fix lost xattrs of directories · bbf156f7
      Jaegeuk Kim 提交于
      This patch enhances the xattr consistency of dirs from suddern power-cuts.
      
      Possible scenario would be:
      1. dir->setxattr used by per-file encryption
      2. file->setxattr goes into inline_xattr
      3. file->fsync
      
      In that case, we should do checkpoint for #1.
      Otherwise we'd lose dir's key information for the file given #2.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      bbf156f7