1. 08 Jul, 2016 3 commits
    • Chao Yu's avatar
      f2fs: fix to redirty page if fail to gc data page · 72e1c797
      Chao Yu authored
      If we fail to move data page during foreground GC, we should give another
      chance to writeback that page which was set dirty previously by writer.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      72e1c797
    • Chao Yu's avatar
      f2fs: fix to detect truncation prior rather than EIO during read · 1563ac75
      Chao Yu authored
      In procedure of synchonized read, after sending out the read request, reader
      will try to lock the page for waiting device to finish the read jobs and
      unlock the page, but meanwhile, truncater will race with reader, so after
      reader get lock of the page, it should check page's mapping to detect
      whether someone has truncated the page in advance, then reader has the
      chance to do the retry if truncation was done, otherwise read can be failed
      due to previous condition check.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      1563ac75
    • Chao Yu's avatar
      f2fs: fix to avoid reading out encrypted data in page cache · 78682f79
      Chao Yu authored
      For encrypted inode, if user overwrites data of the inode, f2fs will read
      encrypted data into page cache, and then do the decryption.
      
      However reader can race with overwriter, and it will see encrypted data
      which has not been decrypted by overwriter yet. Fix it by moving decrypting
      work to background and keep page non-uptodated until data is decrypted.
      
      Thread A				Thread B
      - f2fs_file_write_iter
       - __generic_file_write_iter
        - generic_perform_write
         - f2fs_write_begin
          - f2fs_submit_page_bio
      					- generic_file_read_iter
      					 - do_generic_file_read
      					  - lock_page_killable
      					  - unlock_page
      					  - copy_page_to_iter
      					  hit the encrypted data in updated page
          - lock_page
          - fscrypt_decrypt_page
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      78682f79
  2. 06 Jul, 2016 6 commits
  3. 15 Jun, 2016 1 commit
  4. 13 Jun, 2016 2 commits
    • Jaegeuk Kim's avatar
      f2fs: fix deadlock in add_link failure · c92737ce
      Jaegeuk Kim authored
      mkdir                        sync_dirty_inode
       - init_inode_metadata
         - lock_page(node)
         - make_empty_dir
                                   - filemap_fdatawrite()
                                    - do_writepages
                                    - lock_page(data)
                                    - write_page(data)
                                     - lock_page(node)
         - f2fs_init_acl
          - error
         - truncate_inode_pages
          - lock_page(data)
      
      So, we don't need to truncate data pages in this error case, which will
      be done by f2fs_evict_inode.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      c92737ce
    • Jaegeuk Kim's avatar
      f2fs: introduce mode=lfs mount option · 36abef4e
      Jaegeuk Kim authored
      This mount option is to enable original log-structured filesystem forcefully.
      So, there should be no random writes for main area.
      
      Especially, this supports host-managed SMR device.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      36abef4e
  5. 08 Jun, 2016 4 commits
  6. 07 Jun, 2016 6 commits
  7. 03 Jun, 2016 18 commits