1. 07 7月, 2016 2 次提交
  2. 03 6月, 2016 6 次提交
  3. 11 4月, 2016 1 次提交
  4. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  5. 31 3月, 2016 1 次提交
  6. 18 3月, 2016 3 次提交
  7. 03 3月, 2016 1 次提交
  8. 23 2月, 2016 3 次提交
    • C
      f2fs: fix to delete old dirent in converted inline directory in ->rename · 993a0499
      Chao Yu 提交于
      When doing test with fstests/generic/068 in inline_dentry enabled f2fs,
      following oops dmesg will be reported:
      
       ------------[ cut here ]------------
       WARNING: CPU: 5 PID: 11841 at fs/inode.c:273 drop_nlink+0x49/0x50()
       Modules linked in: f2fs(O) ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
       CPU: 5 PID: 11841 Comm: fsstress Tainted: G           O    4.5.0-rc1 #45
       Hardware name: Hewlett-Packard HP Z220 CMT Workstation/1790, BIOS K51 v01.61 05/16/2013
        0000000000000111 ffff88009cdf7ae8 ffffffff813e5944 0000000000002e41
        0000000000000000 0000000000000111 0000000000000000 ffff88009cdf7b28
        ffffffff8106a587 ffff88009cdf7b58 ffff8804078fe180 ffff880374a64e00
       Call Trace:
        [<ffffffff813e5944>] dump_stack+0x48/0x64
        [<ffffffff8106a587>] warn_slowpath_common+0x97/0xe0
        [<ffffffff8106a5ea>] warn_slowpath_null+0x1a/0x20
        [<ffffffff81231039>] drop_nlink+0x49/0x50
        [<ffffffffa07b95b4>] f2fs_rename2+0xe04/0x10c0 [f2fs]
        [<ffffffff81231ff1>] ? lock_two_nondirectories+0x81/0x90
        [<ffffffff813f454d>] ? lockref_get+0x1d/0x30
        [<ffffffff81220f70>] vfs_rename+0x2e0/0x640
        [<ffffffff8121f9db>] ? lookup_dcache+0x3b/0xd0
        [<ffffffff810b8e41>] ? update_fast_ctr+0x21/0x40
        [<ffffffff8134ff12>] ? security_path_rename+0xa2/0xd0
        [<ffffffff81224af6>] SYSC_renameat2+0x4b6/0x540
        [<ffffffff810ba8ed>] ? trace_hardirqs_off+0xd/0x10
        [<ffffffff810022ba>] ? exit_to_usermode_loop+0x7a/0xd0
        [<ffffffff817e0ade>] ? int_ret_from_sys_call+0x52/0x9f
        [<ffffffff810bdc90>] ? trace_hardirqs_on_caller+0x100/0x1c0
        [<ffffffff81224b8e>] SyS_renameat2+0xe/0x10
        [<ffffffff8121f08e>] SyS_rename+0x1e/0x20
        [<ffffffff817e0957>] entry_SYSCALL_64_fastpath+0x12/0x6f
       ---[ end trace 2b31e17995404e42 ]---
      
      This is because: in the same inline directory, when we renaming one file
      from source name to target name which is not existed, once space of inline
      dentry is not enough, inline conversion will be triggered, after that all
      data in inline dentry will be moved to normal dentry page.
      
      After attaching the new entry in coverted dentry page, still we try to
      remove old entry in original inline dentry, since old entry has been
      moved, so it obviously doesn't make any effect, result in remaining old
      entry in converted dentry page.
      
      Now, we have two valid dentries pointed to the same inode which has nlink
      value of 1, deleting them both, above warning appears.
      
      This issue can be reproduced easily as below steps:
      1. mount f2fs with inline_dentry option
      2. mkdir dir
      3. touch 180 files named [001-180] in dir
      4. rename dir/180 dir/181
      5. rm dir/180 dir/181
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      993a0499
    • C
      f2fs: detect error of update_dent_inode in ->rename · 9def1e92
      Chao Yu 提交于
      Should check and show correct return value of update_dent_inode in
      ->rename.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      9def1e92
    • C
      f2fs crypto: avoid unneeded memory allocation when {en/de}crypting symlink · 922ec355
      Chao Yu 提交于
      This patch adopts f2fs with codes of ext4, it removes unneeded memory
      allocation in creating/accessing path of symlink.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      922ec355
  9. 09 1月, 2016 1 次提交
  10. 01 1月, 2016 1 次提交
  11. 31 12月, 2015 6 次提交
  12. 09 12月, 2015 2 次提交
    • A
      replace ->follow_link() with new method that could stay in RCU mode · 6b255391
      Al Viro 提交于
      new method: ->get_link(); replacement of ->follow_link().  The differences
      are:
      	* inode and dentry are passed separately
      	* might be called both in RCU and non-RCU mode;
      the former is indicated by passing it a NULL dentry.
      	* when called that way it isn't allowed to block
      and should return ERR_PTR(-ECHILD) if it needs to be called
      in non-RCU mode.
      
      It's a flagday change - the old method is gone, all in-tree instances
      converted.  Conversion isn't hard; said that, so far very few instances
      do not immediately bail out when called in RCU mode.  That'll change
      in the next commits.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6b255391
    • A
      don't put symlink bodies in pagecache into highmem · 21fc61c7
      Al Viro 提交于
      kmap() in page_follow_link_light() needed to go - allowing to hold
      an arbitrary number of kmaps for long is a great way to deadlocking
      the system.
      
      new helper (inode_nohighmem(inode)) needs to be used for pagecache
      symlinks inodes; done for all in-tree cases.  page_follow_link_light()
      instrumented to yell about anything missed.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      21fc61c7
  13. 10 11月, 2015 1 次提交
  14. 23 10月, 2015 1 次提交
    • C
      f2fs: fix error path of ->symlink · a6be014e
      Chao Yu 提交于
      Now, in ->symlink of f2fs, we kept the fixed invoking order between
      f2fs_add_link and page_symlink since we should init node info firstly
      in f2fs_add_link, then such node info can be used in page_symlink.
      
      But we didn't fix to release meta info which was done before page_symlink
      in our error path, so this will leave us corrupt symlink entry in its
      parent's dentry page. Fix this issue by adding f2fs_unlink in the error
      path for removing such linking.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a6be014e
  15. 10 10月, 2015 1 次提交
    • J
      f2fs crypto: allocate buffer for decrypting filename · 569cf187
      Jaegeuk Kim 提交于
      We got dentry pages from high_mem, and its address space directly goes into the
      decryption path via f2fs_fname_disk_to_usr.
      But, sg_init_one assumes the address is not from high_mem, so we can get this
      panic since it doesn't call kmap_high but kunmap_high is triggered at the end.
      
      kernel BUG at ../../../../../../kernel/mm/highmem.c:290!
      Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
      ...
       (kunmap_high+0xb0/0xb8) from [<c0114534>] (__kunmap_atomic+0xa0/0xa4)
       (__kunmap_atomic+0xa0/0xa4) from [<c035f028>] (blkcipher_walk_done+0x128/0x1ec)
       (blkcipher_walk_done+0x128/0x1ec) from [<c0366c24>] (crypto_cbc_decrypt+0xc0/0x170)
       (crypto_cbc_decrypt+0xc0/0x170) from [<c0367148>] (crypto_cts_decrypt+0xc0/0x114)
       (crypto_cts_decrypt+0xc0/0x114) from [<c035ea98>] (async_decrypt+0x40/0x48)
       (async_decrypt+0x40/0x48) from [<c032ca34>] (f2fs_fname_disk_to_usr+0x124/0x304)
       (f2fs_fname_disk_to_usr+0x124/0x304) from [<c03056fc>] (f2fs_fill_dentries+0xac/0x188)
       (f2fs_fill_dentries+0xac/0x188) from [<c03059c8>] (f2fs_readdir+0x1f0/0x300)
       (f2fs_readdir+0x1f0/0x300) from [<c0218054>] (vfs_readdir+0x90/0xb4)
       (vfs_readdir+0x90/0xb4) from [<c0218418>] (SyS_getdents64+0x64/0xcc)
       (SyS_getdents64+0x64/0xcc) from [<c0105ba0>] (ret_fast_syscall+0x0/0x30)
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      569cf187
  16. 21 8月, 2015 1 次提交
  17. 05 8月, 2015 4 次提交
    • C
      f2fs: stat inline xattr inode number · d5e8f6c9
      Chao Yu 提交于
      This patch adds to stat the number of inline xattr inode for
      showing in debugfs.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d5e8f6c9
    • C
      f2fs: restrict multimedia filename · 741a7bea
      Chao Yu 提交于
      When testing with fs_mark, some blocks were written out as cold
      data which were mixed with warm data, resulting in splitting more
      bios.
      
      This is because fs_mark will create file with random filename as
      below:
      
      559551ee~~~~~~~~15Z29OCC05JCKQP60JQ42MKV
      559551ee~~~~~~~~NZAZ6X8OA8LHIIP6XD0L58RM
      559551ef~~~~~~~~B15YDSWAK789HPSDZKYTW6WM
      559551f1~~~~~~~~2DAE5DPS79785BUNTFWBEMP3
      559551f1~~~~~~~~1MYDY0BKSQCJPI32Q8C514RM
      559551f1~~~~~~~~YQOTMAOMN5CVRFOUNI026MP4
      559551f3~~~~~~~~1WF42LPRTQJNPPGR3EINKMPE
      559551f3~~~~~~~~8Y2NRK7CEPPAA02LY936PJPG
      
      They are regarded as cold file since their filename are ended with
      multimedia files' extension, but this should be wrong as we only
      match the extension of filename, not the whole one.
      
      In this patch, we try to fix the format of multimedia filename to:
      "filename + '.' + extension", then we set cold file only its
      filename matches the format.
      
      So after this change, it will reduce the probability we set the
      wrong cold file, also it helps a little for fs_mark's performance
      on f2fs.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      741a7bea
    • J
      f2fs: use extent_cache by default · 3e72f721
      Jaegeuk Kim 提交于
      We don't need to handle the duplicate extent information.
      
      The integrated rule is:
       - update on-disk extent with largest one tracked by in-memory extent_cache
       - destroy extent_tree for the truncation case
       - drop per-inode extent_cache by shrinker
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3e72f721
    • J
      f2fs: avoid to use failed inode immediately · c9b63bd0
      Jaegeuk Kim 提交于
      Before iput is called, the inode number used by a bad inode can be reassigned
      to other new inode, resulting in any abnormal behaviors on the new inode.
      This should not happen for the new inode.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      c9b63bd0
  18. 02 6月, 2015 4 次提交