1. 01 6月, 2018 14 次提交
  2. 30 5月, 2018 5 次提交
  3. 05 5月, 2018 1 次提交
  4. 03 5月, 2018 6 次提交
    • J
      f2fs: clear PageError on writepage · 17c50035
      Jaegeuk Kim 提交于
      This patch clears PageError in some pages tagged by read path, but when we
      write the pages with valid contents, writepage should clear the bit likewise
      ext4.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      17c50035
    • J
      f2fs: check cap_resource only for data blocks · a90a0884
      Jaegeuk Kim 提交于
      This patch changes the rule to check cap_resource for data blocks, not inode
      or node blocks in order to avoid selinux denial.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a90a0884
    • J
      Revert "f2fs: introduce f2fs_set_page_dirty_nobuffer" · b87078ad
      Jaegeuk Kim 提交于
      This patch reverts copied f2fs_set_page_dirty_nobuffer to use generic function
      for stability.
      
      This reverts commit fe76b796.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b87078ad
    • E
      f2fs: call unlock_new_inode() before d_instantiate() · ab3835aa
      Eric Biggers 提交于
      xfstest generic/429 sometimes hangs on f2fs, caused by a thread being
      unable to take a directory's i_rwsem for write in vfs_rmdir().  In the
      test, one thread repeatedly creates and removes a directory, and other
      threads repeatedly look up a file in the directory.  The bug is that
      f2fs_mkdir() calls d_instantiate() before unlock_new_inode(), resulting
      in the directory inode being exposed to lookups before it has been fully
      initialized.  And with CONFIG_DEBUG_LOCK_ALLOC, unlock_new_inode()
      reinitializes ->i_rwsem, corrupting its state when it is already held.
      
      Fix it by calling unlock_new_inode() before d_instantiate().  This
      matches what other filesystems do.
      
      Fixes: 57397d86 ("f2fs: add inode operations for special inodes")
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ab3835aa
    • E
      f2fs: refactor read path to allow multiple postprocessing steps · 6dbb1796
      Eric Biggers 提交于
      Currently f2fs's ->readpage() and ->readpages() assume that either the
      data undergoes no postprocessing, or decryption only.  But with
      fs-verity, there will be an additional authenticity verification step,
      and it may be needed either by itself, or combined with decryption.
      
      To support this, store a 'struct bio_post_read_ctx' in ->bi_private
      which contains a work struct, a bitmask of postprocessing steps that are
      enabled, and an indicator of the current step.  The bio completion
      routine, if there was no I/O error, enqueues the first postprocessing
      step.  When that completes, it continues to the next step.  Pages that
      fail any postprocessing step have PageError set.  Once all steps have
      completed, pages without PageError set are set Uptodate, and all pages
      are unlocked.
      
      Also replace f2fs_encrypted_file() with a new function
      f2fs_post_read_required() in places like direct I/O and garbage
      collection that really should be testing whether the file needs special
      I/O processing, not whether it is encrypted specifically.
      
      This may also be useful for other future f2fs features such as
      compression.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6dbb1796
    • E
      fscrypt: allow synchronous bio decryption · 0cb8dae4
      Eric Biggers 提交于
      Currently, fscrypt provides fscrypt_decrypt_bio_pages() which decrypts a
      bio's pages asynchronously, then unlocks them afterwards.  But, this
      assumes that decryption is the last "postprocessing step" for the bio,
      so it's incompatible with additional postprocessing steps such as
      authenticity verification after decryption.
      
      Therefore, rename the existing fscrypt_decrypt_bio_pages() to
      fscrypt_enqueue_decrypt_bio().  Then, add fscrypt_decrypt_bio() which
      decrypts the pages in the bio synchronously without unlocking the pages,
      nor setting them Uptodate; and add fscrypt_enqueue_decrypt_work(), which
      enqueues work on the fscrypt_read_workqueue.  The new functions will be
      used by filesystems that support both fscrypt and fs-verity.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0cb8dae4
  5. 12 4月, 2018 2 次提交
  6. 04 4月, 2018 1 次提交
  7. 03 4月, 2018 3 次提交
  8. 29 3月, 2018 1 次提交
    • E
      f2fs: reserve bits for fs-verity · 53fedcc0
      Eric Biggers 提交于
      Reserve an F2FS feature flag and inode flag for fs-verity.  This is an
      in-development feature that is planned be discussed at LSF/MM 2018 [1].
      It will provide file-based integrity and authenticity for read-only
      files.  Most code will be in a filesystem-independent module, with
      smaller changes needed to individual filesystems that opt-in to
      supporting the feature.  An early prototype supporting F2FS is available
      [2].  Reserving the F2FS on-disk bits for fs-verity will prevent users
      of the prototype from conflicting with other new F2FS features.
      
      Note that we're reserving the inode flag in f2fs_inode.i_advise, which
      isn't really appropriate since it's not a hint or advice.  But
      ->i_advise is already being used to hold the 'encrypt' flag; and F2FS's
      ->i_flags uses the generic FS_* values, so it seems ->i_flags can't be
      used for an F2FS-specific flag without additional work to remove the
      assumption that ->i_flags uses the generic flags namespace.
      
      [1] https://marc.info/?l=linux-fsdevel&m=151690752225644
      [2] https://git.kernel.org/pub/scm/linux/kernel/git/mhalcrow/linux.git/log/?h=fs-verity-devSigned-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      53fedcc0
  9. 28 3月, 2018 4 次提交
  10. 19 3月, 2018 2 次提交
    • Y
      f2fs: check blkaddr more accuratly before issue a bio · 0833721e
      Yunlei He 提交于
      This patch check blkaddr more accuratly before issue a
      write or read bio.
      Signed-off-by: NYunlei He <heyunlei@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0833721e
    • R
      f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read · 02117b8a
      Ritesh Harjani 提交于
      Quota code itself is serializing the operations by taking mutex_lock.
      It seems a below deadlock can happen if GF_NOFS is not used in
      f2fs_quota_read
      
      __switch_to+0x88
      __schedule+0x5b0
      schedule+0x78
      schedule_preempt_disabled+0x20
      __mutex_lock_slowpath+0xdc   		//mutex owner is itself
      mutex_lock+0x2c
      dquot_commit+0x30			//mutex_lock(&dqopt->dqio_mutex);
      dqput+0xe0
      __dquot_drop+0x80
      dquot_drop+0x48
      f2fs_evict_inode+0x218
      evict+0xa8
      dispose_list+0x3c
      prune_icache_sb+0x58
      super_cache_scan+0xf4
      do_shrink_slab+0x208
      shrink_slab.part.40+0xac
      shrink_zone+0x1b0
      do_try_to_free_pages+0x25c
      try_to_free_pages+0x164
      __alloc_pages_nodemask+0x534
      do_read_cache_page+0x6c
      read_cache_page+0x14
      f2fs_quota_read+0xa4
      read_blk+0x54
      find_tree_dqentry+0xe4
      find_tree_dqentry+0xb8
      find_tree_dqentry+0xb8
      find_tree_dqentry+0xb8
      qtree_read_dquot+0x68
      v2_read_dquot+0x24
      dquot_acquire+0x5c			// mutex_lock(&dqopt->dqio_mutex);
      dqget+0x238
      __dquot_initialize+0xd4
      dquot_initialize+0x10
      dquot_file_open+0x34
      f2fs_file_open+0x6c
      do_dentry_open+0x1e4
      vfs_open+0x6c
      path_openat+0xa20
      do_filp_open+0x4c
      do_sys_open+0x178
      Signed-off-by: NRitesh Harjani <riteshh@codeaurora.org>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      02117b8a
  11. 17 3月, 2018 1 次提交