1. 01 6月, 2018 23 次提交
  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. 02 5月, 2018 4 次提交
  6. 01 5月, 2018 1 次提交
    • L
      Merge tag 'errseq-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux · fff75eb2
      Linus Torvalds 提交于
      Pull errseq infrastructure fix from Jeff Layton:
       "The PostgreSQL developers recently had a spirited discussion about the
        writeback error handling in Linux, and reached out to us about a
        behavoir change to the code that bit them when the errseq_t changes
        were merged.
      
        When we changed to using errseq_t for tracking writeback errors, we
        lost the ability for an application to see a writeback error that
        occurred before the open on which the fsync was issued. This was
        problematic for PostgreSQL which offloads fsync calls to a completely
        separate process from the DB writers.
      
        This patch restores that ability. If the errseq_t value in the inode
        does not have the SEEN flag set, then we just return 0 for the sample.
        That ensures that any recorded error is always delivered at least
        once.
      
        Note that we might still lose the error if the inode gets evicted from
        the cache before anything can reopen it, but that was the case before
        errseq_t was merged. At LSF/MM we had some discussion about keeping
        inodes with unreported writeback errors around in the cache for longer
        (possibly indefinitely), but that's really a separate problem"
      
      * tag 'errseq-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
        errseq: Always report a writeback error once
      fff75eb2