An error occurred fetching the project authors.
  1. 19 Apr, 2024 1 commit
  2. 12 Apr, 2024 1 commit
  3. 09 Apr, 2024 1 commit
  4. 26 Mar, 2024 1 commit
  5. 14 Mar, 2024 1 commit
  6. 13 Mar, 2024 2 commits
    • Zhiguo Niu's avatar
      f2fs: fix to handle error paths of {new,change}_curseg() · 24593061
      Zhiguo Niu authored
      {new,change}_curseg() may return error in some special cases,
      error handling should be did in their callers, and this will also
      facilitate subsequent error path expansion in {new,change}_curseg().
      Signed-off-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      24593061
    • Chao Yu's avatar
      f2fs: fix to truncate meta inode pages forcely · 9f0c4a46
      Chao Yu authored
      Below race case can cause data corruption:
      
      Thread A				GC thread
      					- gc_data_segment
      					 - ra_data_block
      					  - locked meta_inode page
      - f2fs_inplace_write_data
       - invalidate_mapping_pages
       : fail to invalidate meta_inode page
         due to lock failure or dirty|writeback
         status
       - f2fs_submit_page_bio
       : write last dirty data to old blkaddr
      					 - move_data_block
      					  - load old data from meta_inode page
      					  - f2fs_submit_page_write
      					  : write old data to new blkaddr
      
      Because invalidate_mapping_pages() will skip invalidating page which
      has unclear status including locked, dirty, writeback and so on, so
      we need to use truncate_inode_pages_range() instead of
      invalidate_mapping_pages() to make sure meta_inode page will be dropped.
      
      Fixes: 6aa58d8a ("f2fs: readahead encrypted block during GC")
      Fixes: e3b49ea3 ("f2fs: invalidate META_MAPPING before IPU/DIO write")
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      9f0c4a46
  7. 04 Mar, 2024 3 commits
  8. 29 Feb, 2024 3 commits
  9. 27 Feb, 2024 4 commits
  10. 25 Feb, 2024 1 commit
  11. 20 Feb, 2024 1 commit
  12. 08 Feb, 2024 1 commit
  13. 06 Feb, 2024 8 commits
  14. 23 Jan, 2024 1 commit
  15. 11 Dec, 2023 5 commits
  16. 28 Nov, 2023 1 commit
    • Chao Yu's avatar
      f2fs: sysfs: support discard_io_aware · d346fa09
      Chao Yu authored
      It gives a way to enable/disable IO aware feature for background
      discard, so that we can tune background discard more precisely
      based on undiscard condition. e.g. force to disable IO aware if
      there are large number of discard extents, and discard IO may
      always be interrupted by frequent common IO.
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      d346fa09
  17. 28 Oct, 2023 1 commit
  18. 18 Oct, 2023 1 commit
  19. 21 Aug, 2023 1 commit
    • Jaegeuk Kim's avatar
      f2fs: avoid false alarm of circular locking · 5c13e238
      Jaegeuk Kim authored
      ======================================================
      WARNING: possible circular locking dependency detected
      6.5.0-rc5-syzkaller-00353-gae545c32 #0 Not tainted
      ------------------------------------------------------
      syz-executor273/5027 is trying to acquire lock:
      ffff888077fe1fb0 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
      ffff888077fe1fb0 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_add_inline_entry+0x300/0x6f0 fs/f2fs/inline.c:644
      
      but task is already holding lock:
      ffff888077fe07c8 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
      ffff888077fe07c8 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_add_dentry+0x92/0x230 fs/f2fs/dir.c:783
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&fi->i_xattr_sem){.+.+}-{3:3}:
             down_read+0x9c/0x470 kernel/locking/rwsem.c:1520
             f2fs_down_read fs/f2fs/f2fs.h:2108 [inline]
             f2fs_getxattr+0xb1e/0x12c0 fs/f2fs/xattr.c:532
             __f2fs_get_acl+0x5a/0x900 fs/f2fs/acl.c:179
             f2fs_acl_create fs/f2fs/acl.c:377 [inline]
             f2fs_init_acl+0x15c/0xb30 fs/f2fs/acl.c:420
             f2fs_init_inode_metadata+0x159/0x1290 fs/f2fs/dir.c:558
             f2fs_add_regular_entry+0x79e/0xb90 fs/f2fs/dir.c:740
             f2fs_add_dentry+0x1de/0x230 fs/f2fs/dir.c:788
             f2fs_do_add_link+0x190/0x280 fs/f2fs/dir.c:827
             f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
             f2fs_mkdir+0x377/0x620 fs/f2fs/namei.c:781
             vfs_mkdir+0x532/0x7e0 fs/namei.c:4117
             do_mkdirat+0x2a9/0x330 fs/namei.c:4140
             __do_sys_mkdir fs/namei.c:4160 [inline]
             __se_sys_mkdir fs/namei.c:4158 [inline]
             __x64_sys_mkdir+0xf2/0x140 fs/namei.c:4158
             do_syscall_x64 arch/x86/entry/common.c:50 [inline]
             do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
             entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      -> #0 (&fi->i_sem){+.+.}-{3:3}:
             check_prev_add kernel/locking/lockdep.c:3142 [inline]
             check_prevs_add kernel/locking/lockdep.c:3261 [inline]
             validate_chain kernel/locking/lockdep.c:3876 [inline]
             __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144
             lock_acquire kernel/locking/lockdep.c:5761 [inline]
             lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726
             down_write+0x93/0x200 kernel/locking/rwsem.c:1573
             f2fs_down_write fs/f2fs/f2fs.h:2133 [inline]
             f2fs_add_inline_entry+0x300/0x6f0 fs/f2fs/inline.c:644
             f2fs_add_dentry+0xa6/0x230 fs/f2fs/dir.c:784
             f2fs_do_add_link+0x190/0x280 fs/f2fs/dir.c:827
             f2fs_add_link fs/f2fs/f2fs.h:3554 [inline]
             f2fs_mkdir+0x377/0x620 fs/f2fs/namei.c:781
             vfs_mkdir+0x532/0x7e0 fs/namei.c:4117
             ovl_do_mkdir fs/overlayfs/overlayfs.h:196 [inline]
             ovl_mkdir_real+0xb5/0x370 fs/overlayfs/dir.c:146
             ovl_workdir_create+0x3de/0x820 fs/overlayfs/super.c:309
             ovl_make_workdir fs/overlayfs/super.c:711 [inline]
             ovl_get_workdir fs/overlayfs/super.c:864 [inline]
             ovl_fill_super+0xdab/0x6180 fs/overlayfs/super.c:1400
             vfs_get_super+0xf9/0x290 fs/super.c:1152
             vfs_get_tree+0x88/0x350 fs/super.c:1519
             do_new_mount fs/namespace.c:3335 [inline]
             path_mount+0x1492/0x1ed0 fs/namespace.c:3662
             do_mount fs/namespace.c:3675 [inline]
             __do_sys_mount fs/namespace.c:3884 [inline]
             __se_sys_mount fs/namespace.c:3861 [inline]
             __x64_sys_mount+0x293/0x310 fs/namespace.c:3861
             do_syscall_x64 arch/x86/entry/common.c:50 [inline]
             do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
             entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      other info that might help us debug this:
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        rlock(&fi->i_xattr_sem);
                                     lock(&fi->i_sem);
                                     lock(&fi->i_xattr_sem);
        lock(&fi->i_sem);
      
      Cc: <stable@vger.kernel.org>
      Reported-and-tested-by: syzbot+e5600587fa9cbf8e3826@syzkaller.appspotmail.com
      Fixes: 5eda1ad1 "f2fs: fix deadlock in i_xattr_sem and inode page lock"
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      5c13e238
  20. 14 Aug, 2023 2 commits
    • Chao Yu's avatar
      f2fs: fix to account cp stats correctly · eb61c2cc
      Chao Yu authored
      cp_foreground_calls sysfs entry shows total CP call count rather than
      foreground CP call count, fix it.
      
      Fixes: fc7100ea ("f2fs: Add f2fs stats to sysfs")
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      eb61c2cc
    • Chao Yu's avatar
      f2fs: fix to account gc stats correctly · 9bf1dcbd
      Chao Yu authored
      As reported, status debugfs entry shows inconsistent GC stats as below:
      
      GC calls: 6008 (BG: 6161)
        - data segments : 3053 (BG: 3053)
        - node segments : 2955 (BG: 2955)
      
      Total GC calls is larger than BGGC calls, the reason is:
      - f2fs_stat_info.call_count accounts total migrated section count
      by f2fs_gc()
      - f2fs_stat_info.bg_gc accounts total call times of f2fs_gc() from
      background gc_thread
      
      Another issue is gc_foreground_calls sysfs entry shows total GC call
      count rather than FGGC call count.
      
      This patch changes as below for fix:
      - account GC calls and migrated segment count separately
      - support to account migrated section count if it enables large section
      mode
      - fix to show correct value in gc_foreground_calls sysfs entry
      
      Fixes: fc7100ea ("f2fs: Add f2fs stats to sysfs")
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      9bf1dcbd