1. 01 1月, 2016 1 次提交
  2. 31 12月, 2015 5 次提交
  3. 10 11月, 2015 1 次提交
  4. 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
  5. 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
  6. 21 8月, 2015 1 次提交
  7. 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
  8. 02 6月, 2015 5 次提交
    • J
      f2fs crypto: avoid f2fs_inherit_context for symlink · e992e238
      Jaegeuk Kim 提交于
      This patch fixes to call f2fs_inherit_context twice for newly created symlink.
      The original one is called by f2fs_add_link(), which invokes f2fs_setxattr.
      If the second one is called again, f2fs_setxattr is triggered again with same
      encryption index.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e992e238
    • C
      f2fs crypto: check context consistent for rename2 · d3baf7c4
      Chao Yu 提交于
      For exchange rename, we should check context consistent of encryption
      between new_dir and old_inode or old_dir and new_inode. Otherwise
      inheritance of parent's encryption context will be broken.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      [Jaegeuk Kim: sync with ext4 approach]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d3baf7c4
    • J
      f2fs crypto: use per-inode tfm structure · 26bf3dc7
      Jaegeuk Kim 提交于
      This patch applies the following ext4 patch:
      
        ext4 crypto: use per-inode tfm structure
      
      As suggested by Herbert Xu, we shouldn't allocate a new tfm each time
      we read or write a page.  Instead we can use a single tfm hanging off
      the inode's crypt_info structure for all of our encryption needs for
      that inode, since the tfm can be used by multiple crypto requests in
      parallel.
      
      Also use cmpxchg() to avoid races that could result in crypt_info
      structure getting doubly allocated or doubly freed.
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      26bf3dc7
    • J
      f2fs crypto: check encryption for tmpfile · 304eecc3
      Jaegeuk Kim 提交于
      This patch adds to check encryption for tmpfile in early stage.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      304eecc3
    • C
      f2fs: support RENAME_WHITEOUT · 7e01e7ad
      Chao Yu 提交于
      As the description of rename in manual, RENAME_WHITEOUT is a special operation
      that only makes sense for overlay/union type filesystem.
      
      When performing rename with RENAME_WHITEOUT, dst will be replace with src, and
      meanwhile, a 'whiteout' will be create with name of src.
      
      A "whiteout" is designed to be a char device with 0,0 device number, it has
      specially meaning for stackable filesystem. In these filesystems, there are
      multiple layers exist, and only top of these can be modified. So a whiteout
      in top layer is used to hide a corresponding file in lower layer, as well
      removal of whiteout will make the file appear.
      
      Now in overlayfs, when we rename a file which is exist in lower layer, it
      will be copied up to upper if it is not on upper layer yet, and then rename
      it on upper layer, source file will be whiteouted to hide corresponding file
      in lower layer at the same time.
      
      So in upper layer filesystem, implementation of RENAME_WHITEOUT provide a
      atomic operation for stackable filesystem to support rename operation.
      
      There are multiple ways to implement RENAME_WHITEOUT in log of this commit:
      7dcf5c3e ("xfs: add RENAME_WHITEOUT support") which pointed out by
      Dave Chinner.
      
      For now, we just try to follow the way that xfs/ext4 use.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7e01e7ad
  9. 29 5月, 2015 7 次提交
  10. 11 5月, 2015 3 次提交
    • A
      switch ->put_link() from dentry to inode · 5f2c4179
      Al Viro 提交于
      only one instance looks at that argument at all; that sole
      exception wants inode rather than dentry.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5f2c4179
    • A
      don't pass nameidata to ->follow_link() · 6e77137b
      Al Viro 提交于
      its only use is getting passed to nd_jump_link(), which can obtain
      it from current->nameidata
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6e77137b
    • A
      new ->follow_link() and ->put_link() calling conventions · 680baacb
      Al Viro 提交于
      a) instead of storing the symlink body (via nd_set_link()) and returning
      an opaque pointer later passed to ->put_link(), ->follow_link() _stores_
      that opaque pointer (into void * passed by address by caller) and returns
      the symlink body.  Returning ERR_PTR() on error, NULL on jump (procfs magic
      symlinks) and pointer to symlink body for normal symlinks.  Stored pointer
      is ignored in all cases except the last one.
      
      Storing NULL for opaque pointer (or not storing it at all) means no call
      of ->put_link().
      
      b) the body used to be passed to ->put_link() implicitly (via nameidata).
      Now only the opaque pointer is.  In the cases when we used the symlink body
      to free stuff, ->follow_link() now should store it as opaque pointer in addition
      to returning it.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      680baacb
  11. 05 5月, 2015 1 次提交
  12. 17 4月, 2015 2 次提交
  13. 16 4月, 2015 1 次提交
  14. 11 4月, 2015 1 次提交
    • J
      f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries · 510022a8
      Jaegeuk Kim 提交于
      If f2fs was corrupted with missing dot dentries, it needs to recover them after
      fsck.f2fs detection.
      
      The underlying precedure is:
      
      1. The fsck.f2fs remains F2FS_INLINE_DOTS flag in directory inode, if it detects
      missing dot dentries.
      
      2. When f2fs looks up the corrupted directory, it triggers f2fs_add_link with
      proper inode numbers and their dot and dotdot names.
      
      3. Once f2fs recovers the directory without errors, it removes F2FS_INLINE_DOTS
      finally.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      510022a8
  15. 04 3月, 2015 1 次提交
  16. 12 2月, 2015 1 次提交
  17. 24 11月, 2014 1 次提交
  18. 10 11月, 2014 1 次提交
  19. 05 11月, 2014 1 次提交
    • J
      f2fs: revisit inline_data to avoid data races and potential bugs · b3d208f9
      Jaegeuk Kim 提交于
      This patch simplifies the inline_data usage with the following rule.
      1. inline_data is set during the file creation.
      2. If new data is requested to be written ranges out of inline_data,
       f2fs converts that inode permanently.
      3. There is no cases which converts non-inline_data inode to inline_data.
      4. The inline_data flag should be changed under inode page lock.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b3d208f9
  20. 04 11月, 2014 1 次提交