1. 19 Apr, 2017 4 commits
  2. 18 Apr, 2017 1 commit
    • Jaegeuk Kim's avatar
      f2fs: avoid dirty node pages in check_only recovery · d40d30c5
      Jaegeuk Kim authored
      In the check_only mode, we should not make any dirty node pages. Otherwise,
      we can get this panic:
      
      F2FS-fs (nvme0n1p1): Need to recover fsync data
      ------------[ cut here ]------------
      kernel BUG at fs/f2fs/node.c:2204!
      CPU: 7 PID: 19923 Comm: mount Tainted: G           OE   4.9.8 #2
      RIP: 0010:[<ffffffffc0979c0b>]  [<ffffffffc0979c0b>] flush_nat_entries+0x43b/0x7d0 [f2fs]
      Call Trace:
       [<ffffffffc096ddaa>] ? __f2fs_submit_merged_bio+0x5a/0xd0 [f2fs]
       [<ffffffffc096ddaa>] ? __f2fs_submit_merged_bio+0x5a/0xd0 [f2fs]
       [<ffffffffc096dddb>] ? __f2fs_submit_merged_bio+0x8b/0xd0 [f2fs]
       [<ffffffff860e450f>] ? up_write+0x1f/0x40
       [<ffffffffc096dddb>] ? __f2fs_submit_merged_bio+0x8b/0xd0 [f2fs]
       [<ffffffffc0969f04>] write_checkpoint+0x2f4/0xf20 [f2fs]
       [<ffffffff860e938d>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffffc0960bc9>] ? f2fs_sync_fs+0x79/0x190 [f2fs]
       [<ffffffffc0960bc9>] ? f2fs_sync_fs+0x79/0x190 [f2fs]
       [<ffffffffc0960bd5>] f2fs_sync_fs+0x85/0x190 [f2fs]
       [<ffffffffc097b6de>] f2fs_balance_fs_bg+0x7e/0x1c0 [f2fs]
       [<ffffffffc0977b64>] f2fs_write_node_pages+0x34/0x350 [f2fs]
       [<ffffffff860e5f42>] ? __lock_is_held+0x52/0x70
       [<ffffffff861d9b31>] do_writepages+0x21/0x30
       [<ffffffff86298ce1>] __writeback_single_inode+0x61/0x760
       [<ffffffff86909127>] ? _raw_spin_unlock+0x27/0x40
       [<ffffffff8629a735>] writeback_single_inode+0xd5/0x190
       [<ffffffff8629a889>] write_inode_now+0x99/0xc0
       [<ffffffff86283876>] iput+0x1f6/0x2c0
       [<ffffffffc0964b52>] f2fs_fill_super+0xc32/0x10c0 [f2fs]
       [<ffffffff86266462>] mount_bdev+0x182/0x1b0
       [<ffffffffc0963f20>] ? f2fs_commit_super+0x100/0x100 [f2fs]
       [<ffffffffc0960da5>] f2fs_mount+0x15/0x20 [f2fs]
       [<ffffffff86266e08>] mount_fs+0x38/0x170
       [<ffffffff86288bab>] vfs_kern_mount+0x6b/0x160
       [<ffffffff8628bcfe>] do_mount+0x1be/0xd60
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      d40d30c5
  3. 12 Apr, 2017 5 commits
  4. 11 Apr, 2017 11 commits
  5. 05 Apr, 2017 9 commits
  6. 30 Mar, 2017 3 commits
  7. 28 Mar, 2017 1 commit
  8. 25 Mar, 2017 1 commit
  9. 24 Mar, 2017 5 commits
    • Chao Yu's avatar
      f2fs: don't reserve additional space in xattr block · 22588f87
      Chao Yu authored
      In this patch, we change xattr block disk layout as below:
      
      Before:
      			xattr node block layout
      +---------------------------------------------+---------------+-------------+
      |           node block xattr entries          |   reserved    | node footer |
      |                  4068 Bytes                 |    4 Bytes    |  24 Bytes   |
      
      			In memory layout
      +--------------------+---------------------------------+--------------------+
      |    inline xattr    |     node block xattr entries    |      reserved      |
      |     200 Bytes      |         4068 Bytes              |      4 Bytes       |
      
      After:
      			xattr node block layout
      +-------------------------------------------------------------+-------------+
      |                  node block xattr entries                   | node footer |
      |                         4072 Bytes                          |  24 Bytes   |
      
      			In memory layout
      +--------------------+---------------------------------+--------------------+
      |    inline xattr    |     node block xattr entries    |      reserved      |
      |     200 Bytes      |         4072 Bytes              |      4 Bytes       |
      
      With this change, we don't need to reserve additional space in node block,
      just keep reserved space in logical in-memory layout. So that it would help
      to enlarge valid free space of xattr node block.
      
      As tested, generic/026 shows max stored xattr entires number increases from
      531 to 532 when inline_xattr option is enabled.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      22588f87
    • Chao Yu's avatar
      f2fs: clean up xattr operation · 89e9eabd
      Chao Yu authored
      1. don't allocate redundant memory in read_all_xattrs.
      2. introduce RESERVED_XATTR_SIZE for cleanup.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Reviewed-by: default avatarKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      89e9eabd
    • Chao Yu's avatar
      f2fs: don't track volatile file in dirty inode list · 99f4b917
      Chao Yu authored
      Don't track volatile file in dirty inode list, otherwise with data_flush
      option, background thread will entry into endless loop for flushing
      journal file's pages.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      99f4b917
    • Chao Yu's avatar
      f2fs: show the max number of volatile operations · 648d50ba
      Chao Yu authored
      This patch adds to show the max number of volatile operations which are
      conducting concurrently.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      648d50ba
    • Chao Yu's avatar
      f2fs: fix race condition in between free nid allocator/initializer · 30a61ddf
      Chao Yu authored
      In below concurrent case, allocated nid can be loaded into free nid cache
      and be allocated again.
      
      Thread A				Thread B
      - f2fs_create
       - f2fs_new_inode
        - alloc_nid
         - __insert_nid_to_list(ALLOC_NID_LIST)
      					- f2fs_balance_fs_bg
      					 - build_free_nids
      					  - __build_free_nids
      					   - scan_nat_page
      					    - add_free_nid
      					     - __lookup_nat_cache
       - f2fs_add_link
        - init_inode_metadata
         - new_inode_page
          - new_node_page
           - set_node_addr
       - alloc_nid_done
        - __remove_nid_from_list(ALLOC_NID_LIST)
      					     - __insert_nid_to_list(FREE_NID_LIST)
      
      This patch makes nat cache lookup and free nid list operation being atomical
      to avoid this race condition.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      30a61ddf