1. 26 7月, 2020 3 次提交
  2. 24 7月, 2020 2 次提交
  3. 22 7月, 2020 2 次提交
    • D
      f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl · 9af84648
      Daeho Jeong 提交于
      Added a new ioctl to send discard commands or/and zero out
      to selected data area of a regular file for security reason.
      
      The way of handling range.len of F2FS_IOC_SEC_TRIM_FILE:
      1. Added -1 value support for range.len to secure trim the whole blocks
         starting from range.start regardless of i_size.
      2. If the end of the range passes over the end of file, it means until
         the end of file (i_size).
      3. ignored the case of that range.len is zero to prevent the function
         from making end_addr zero and triggering different behaviour of
         the function.
      Signed-off-by: NDaeho Jeong <daehojeong@google.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      9af84648
    • J
      f2fs: should avoid inode eviction in synchronous path · b0f3b87f
      Jaegeuk Kim 提交于
      https://bugzilla.kernel.org/show_bug.cgi?id=208565
      
      PID: 257    TASK: ecdd0000  CPU: 0   COMMAND: "init"
        #0 [<c0b420ec>] (__schedule) from [<c0b423c8>]
        #1 [<c0b423c8>] (schedule) from [<c0b459d4>]
        #2 [<c0b459d4>] (rwsem_down_read_failed) from [<c0b44fa0>]
        #3 [<c0b44fa0>] (down_read) from [<c044233c>]
        #4 [<c044233c>] (f2fs_truncate_blocks) from [<c0442890>]
        #5 [<c0442890>] (f2fs_truncate) from [<c044d408>]
        #6 [<c044d408>] (f2fs_evict_inode) from [<c030be18>]
        #7 [<c030be18>] (evict) from [<c030a558>]
        #8 [<c030a558>] (iput) from [<c047c600>]
        #9 [<c047c600>] (f2fs_sync_node_pages) from [<c0465414>]
       #10 [<c0465414>] (f2fs_write_checkpoint) from [<c04575f4>]
       #11 [<c04575f4>] (f2fs_sync_fs) from [<c0441918>]
       #12 [<c0441918>] (f2fs_do_sync_file) from [<c0441098>]
       #13 [<c0441098>] (f2fs_sync_file) from [<c0323fa0>]
       #14 [<c0323fa0>] (vfs_fsync_range) from [<c0324294>]
       #15 [<c0324294>] (do_fsync) from [<c0324014>]
       #16 [<c0324014>] (sys_fsync) from [<c0108bc0>]
      
      This can be caused by flush_dirty_inode() in f2fs_sync_node_pages() where
      iput() requires f2fs_lock_op() again resulting in livelock.
      Reported-by: NZhiguo Niu <Zhiguo.Niu@unisoc.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b0f3b87f
  4. 21 7月, 2020 3 次提交
  5. 09 7月, 2020 5 次提交
  6. 08 7月, 2020 22 次提交
  7. 19 6月, 2020 3 次提交
    • W
      f2fs: use kfree() to free variables allocated by match_strdup() · ba87a45c
      Wang Xiaojun 提交于
      Use kfree() instead of kvfree() to free variables allocated
      by match_strdup(). Because the memory is allocated with kmalloc
      inside match_strdup().
      Signed-off-by: NWang Xiaojun <wangxiaojun11@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ba87a45c
    • J
      f2fs: get the right gc victim section when section has several segments · da52f8ad
      Jack Qiu 提交于
      Assume each section has 4 segment:
           .___________________________.
           |_Segment0_|_..._|_Segment3_|
           .                          .
           .                  .
           .__________.
           |_section0_|
      
      Segment 0~2 has 0 valid block, segment 3 has 512 valid blocks.
      It will fail if we want to gc section0 in this scenes,
      because all 4 segments in section0 is not dirty.
      So we should use dirty section bitmap instead of dirty segment bitmap
      to get right victim section.
      Signed-off-by: NJack Qiu <jack.qiu@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      da52f8ad
    • W
      f2fs: fix a race condition between f2fs_write_end_io and f2fs_del_fsync_node_entry · db5ae363
      Wuyun Zhao 提交于
      Under some condition, the __write_node_page will submit a page which is not
      f2fs_in_warm_node_list and will not call f2fs_add_fsync_node_entry.
      f2fs_gc continue to run to invoke f2fs_iget -> do_read_inode to read the same node page
      and set code node, which make f2fs_in_warm_node_list become true,
      that will cause f2fs_bug_on in f2fs_del_fsync_node_entry when f2fs_write_end_io called.
      
      - f2fs_write_end_io
      					- f2fs_iget
      					 - do_read_inode
      					  - set_cold_node
      					  recover cold node flag
       - f2fs_in_warm_node_list
        - is_cold_node
        if node is cold, assume we have added
        node to fsync_node_list during writepages()
       - f2fs_del_fsync_node_entry
        - f2fs_bug_on() due to node page
        is not in fsync_node_list
      
      [   34.966133] Call trace:
      [   34.969902]  f2fs_del_fsync_node_entry+0x100/0x108
      [   34.976071]  f2fs_write_end_io+0x1e0/0x288
      [   34.981539]  bio_endio+0x248/0x270
      [   34.986289]  blk_update_request+0x2b0/0x4d8
      [   34.991841]  scsi_end_request+0x40/0x440
      [   34.997126]  scsi_io_completion+0xa4/0x748
      [   35.002593]  scsi_finish_command+0xdc/0x110
      [   35.008143]  scsi_softirq_done+0x118/0x150
      [   35.013610]  blk_done_softirq+0x8c/0xe8
      [   35.018811]  __do_softirq+0x2e8/0x578
      [   35.023828]  irq_exit+0xfc/0x120
      [   35.028398]  handle_IPI+0x1d8/0x330
      [   35.033233]  gic_handle_irq+0x110/0x1d4
      [   35.038433]  el1_irq+0xb4/0x130
      [   35.042917]  kmem_cache_alloc+0x3f0/0x418
      [   35.048288]  radix_tree_node_alloc+0x50/0xf8
      [   35.053933]  __radix_tree_create+0xf8/0x188
      [   35.059484]  __radix_tree_insert+0x3c/0x128
      [   35.065035]  add_gc_inode+0x90/0x118
      [   35.069967]  f2fs_gc+0x1b80/0x2d70
      [   35.074718]  f2fs_disable_checkpoint+0x94/0x1d0
      [   35.080621]  f2fs_fill_super+0x10c4/0x1b88
      [   35.086088]  mount_bdev+0x194/0x1e0
      [   35.090923]  f2fs_mount+0x40/0x50
      [   35.095589]  mount_fs+0xb4/0x190
      [   35.100159]  vfs_kern_mount+0x80/0x1d8
      [   35.105260]  do_mount+0x478/0xf18
      [   35.109926]  ksys_mount+0x90/0xd0
      [   35.114592]  __arm64_sys_mount+0x24/0x38
      Signed-off-by: NWuyun Zhao <zhaowuyun@wingtech.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      db5ae363