1. 09 Jun, 2020 1 commit
    • Eric Biggers's avatar
      f2fs: don't return vmalloc() memory from f2fs_kmalloc() · 0b6d4ca0
      Eric Biggers authored
      kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either
      kmalloc'ed or vmalloc'ed memory.  But the f2fs wrappers, f2fs_kmalloc()
      and f2fs_kvmalloc(), both return both kinds of memory.
      
      It's redundant to have two functions that do the same thing, and also
      breaking the standard naming convention is causing bugs since people
      assume it's safe to kfree() memory allocated by f2fs_kmalloc().  See
      e.g. the various allocations in fs/f2fs/compress.c.
      
      Fix this by making f2fs_kmalloc() just use kmalloc().  And to avoid
      re-introducing the allocation failures that the vmalloc fallback was
      intended to fix, convert the largest allocations to use f2fs_kvmalloc().
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      0b6d4ca0
  2. 04 Jun, 2020 1 commit
    • Sahitya Tummala's avatar
      f2fs: fix retry logic in f2fs_write_cache_pages() · e78790f8
      Sahitya Tummala authored
      In case a compressed file is getting overwritten, the current retry
      logic doesn't include the current page to be retried now as it sets
      the new start index as 0 and new end index as writeback_index - 1.
      This causes the corresponding cluster to be uncompressed and written
      as normal pages without compression. Fix this by allowing writeback to
      be retried for the current page as well (in case of compressed page
      getting retried due to index mismatch with cluster index). So that
      this cluster can be written compressed in case of overwrite.
      
      Also, align f2fs_write_cache_pages() according to the change -
      <64081362>("mm/page-writeback.c: fix range_cyclic writeback vs
      writepages deadlock").
      Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
      Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      e78790f8
  3. 30 May, 2020 1 commit
    • Chao Yu's avatar
      f2fs: fix wrong discard space · ca7f76e6
      Chao Yu authored
      Under heavy fsstress, we may triggle panic while issuing discard,
      because __check_sit_bitmap() detects that discard command may earse
      valid data blocks, the root cause is as below race stack described,
      since we removed lock when flushing quota data, quota data writeback
      may race with write_checkpoint(), so that it causes inconsistency in
      between cached discard entry and segment bitmap.
      
      - f2fs_write_checkpoint
       - block_operations
        - set_sbi_flag(sbi, SBI_QUOTA_SKIP_FLUSH)
       - f2fs_flush_sit_entries
        - add_discard_addrs
         - __set_bit_le(i, (void *)de->discard_map);
      						- f2fs_write_data_pages
      						 - f2fs_write_single_data_page
      						   : inode is quota one, cp_rwsem won't be locked
      						  - f2fs_do_write_data_page
      						   - f2fs_allocate_data_block
      						    - f2fs_wait_discard_bio
      						      : discard entry has not been added yet.
      						    - update_sit_entry
       - f2fs_clear_prefree_segments
        - f2fs_issue_discard
        : add discard entry
      
      In order to fix this, this patch uses node_write to serialize
      f2fs_allocate_data_block and checkpoint.
      
      Fixes: 435cbab9 ("f2fs: fix quota_sync failure due to f2fs_lock_op")
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      ca7f76e6
  4. 28 May, 2020 4 commits
  5. 27 May, 2020 1 commit
  6. 25 May, 2020 1 commit
  7. 18 May, 2020 2 commits
  8. 12 May, 2020 21 commits
  9. 08 May, 2020 6 commits
  10. 24 Apr, 2020 1 commit
  11. 17 Apr, 2020 1 commit