New issue
Advanced search Search tips

Issue 901118 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

chromeos-4.19: Circular locking in fs_reclaim / jbd2_handle

Project Member Reported by groeck@chromium.org, Nov 1

Issue description

Observed when running chromeos-4.19 on caroline.

[  147.806651] ======================================================
[  147.813577] WARNING: possible circular locking dependency detected
[  147.820498] 4.19.0-00948-gcab80fe26740b #3 Tainted: G        W        
[  147.827847] ------------------------------------------------------
[  147.834779] kswapd0/47 is trying to acquire lock:
[  147.840064] 0000000094c720bb (jbd2_handle){++++}, at: start_this_handle+0xbab/0xda6
[  147.848649] 
               but task is already holding lock:
[  147.855190] 00000000c854435f (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x9/0x2a
[  147.863683] 
               which lock already depends on the new lock.

[  147.872845] 
               the existing dependency chain (in reverse order) is:
[  147.881233] 
               -> #2 (fs_reclaim){+.+.}:
[  147.887014]        __fs_reclaim_acquire+0x27/0x2a
[  147.892293]        slab_pre_alloc_hook+0x1a/0x54
[  147.897475]        __kmalloc+0x61/0x1c9
[  147.901782]        mempool_create_node+0x39/0x79
[  147.906962]        fscrypt_initialize+0x124/0x154
[  147.912243]        fscrypt_get_encryption_info+0x153/0x1521
[  147.918496]        ext4_dir_open+0x9b/0xe6
[  147.923095]        do_dentry_open+0x2fe/0xa36
[  147.927978]        path_openat+0x93a/0x2ae0
[  147.932678]        do_filp_open+0x23a/0x384
[  147.937375]        do_sys_open+0x14f/0x606
[  147.941963]        do_syscall_64+0xce/0x121
[  147.946658]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  147.952901] 
               -> #1 (fscrypt_init_mutex){+.+.}:
[  147.959457]        __mutex_lock_common+0x1b6/0x20b6
[  147.964930]        __mutex_lock+0x16/0x1c
[  147.969433]        fscrypt_initialize+0x2c/0x154
[  147.974616]        fscrypt_get_encryption_info+0x153/0x1521
[  147.980869]        fscrypt_inherit_context+0x26f/0x3d4
[  147.986633]        __ext4_new_inode+0x266f/0x39a7
[  147.991905]        ext4_symlink+0x41a/0xc8d
[  147.996599]        vfs_symlink2+0xec/0x10e
[  148.001198]        do_symlinkat+0x1b7/0x23c
[  148.005894]        do_syscall_64+0xce/0x121
[  148.010593]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  148.016836] 
               -> #0 (jbd2_handle){++++}:
[  148.022711]        lock_acquire+0x328/0x447
[  148.027409]        start_this_handle+0xbc9/0xda6
[  148.032591]        jbd2__journal_start+0x1e6/0x673
[  148.037966]        __ext4_journal_start_sb+0x316/0x3d6
[  148.043723]        ext4_release_dquot+0x110/0x1aa
[  148.049004]        dqput+0x145/0x3ff
[  148.053020]        dqput_all+0x3f/0x52
[  148.057227]        __dquot_drop+0x1ad/0x202
[  148.061952]        ext4_clear_inode+0x38/0x166
[  148.066943]        ext4_evict_inode+0x765/0xad9
[  148.072026]        evict+0x25d/0x3da
[  148.076035]        dispose_list+0xfe/0x13f
[  148.080633]        prune_icache_sb+0x10f/0x175
[  148.085620]        super_cache_scan+0x1fb/0x2c7
[  148.090708]        shrink_slab+0x6a2/0xb82
[  148.095306]        shrink_node+0xfcf/0x19e8
[  148.100001]        kswapd+0x1491/0x18ed
[  148.104305]        kthread+0x25c/0x271
[  148.108516]        ret_from_fork+0x3a/0x50
[  148.113107] 
               other info that might help us debug this:

[  148.122072] Chain exists of:
                 jbd2_handle --> fscrypt_init_mutex --> fs_reclaim

[  148.133577]  Possible unsafe locking scenario:

[  148.140213]        CPU0                    CPU1
[  148.145293]        ----                    ----
[  148.150370]   lock(fs_reclaim);
[  148.153895]                                lock(fscrypt_init_mutex);
[  148.161017]                                lock(fs_reclaim);
[  148.167361]   lock(jbd2_handle);
[  148.170986] 
                *** DEADLOCK ***

[  148.177622] 3 locks held by kswapd0/47:
[  148.181923]  #0: 00000000c854435f (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x9/0x2a
[  148.190904]  #1: 0000000007ff5d2d (shrinker_rwsem){++++}, at: shrink_slab+0x9c/0xb82
[  148.199595]  #2: 000000005e78a694 (&type->s_umount_key#44){++++}, at: trylock_super+0x1f/0xa6
[  148.209163] 
               stack backtrace:
[  148.214056] CPU: 2 PID: 47 Comm: kswapd0 Tainted: G        W         4.19.0-00948-gcab80fe26740b #3
[  148.224175] Hardware name: Google Caroline/Caroline, BIOS Google_Caroline.7820.286.0 03/15/2017
[  148.233914] Call Trace:
[  148.236668]  dump_stack+0xfc/0x175
[  148.240483]  ? show_regs_print_info+0x5/0x5
[  148.245181]  ? print_circular_bug+0x243/0x2d1
[  148.250065]  __lock_acquire+0x2339/0x292d
[  148.254568]  ? lock_acquire+0x447/0x447
[  148.258867]  ? _raw_spin_unlock+0xf6/0xf6
[  148.263369]  ? _raw_spin_lock_irqsave+0xc0/0xf2
[  148.268460]  ? match_held_lock+0x257/0x257
[  148.273056]  lock_acquire+0x328/0x447
[  148.277165]  ? start_this_handle+0xbab/0xda6
[  148.281962]  ? lock_downgrade+0x601/0x601
[  148.286458]  ? do_raw_read_unlock+0x3e/0x74
[  148.291152]  ? _raw_read_unlock+0x7d/0xf6
[  148.295658]  start_this_handle+0xbc9/0xda6
[  148.300251]  ? start_this_handle+0xbab/0xda6
[  148.305051]  ? jbd2_free_handle+0x41/0x41
[  148.309549]  ? new_handle+0x4d/0xbd
[  148.313463]  ? kmem_cache_alloc+0x1f2/0x27d
[  148.318156]  ? new_handle+0x4d/0xbd
[  148.322074]  jbd2__journal_start+0x1e6/0x673
[  148.326859]  ? jbd2_journal_free_transaction+0x25/0x25
[  148.332623]  ? rcu_read_lock_sched_held+0xab/0x15b
[  148.338001]  ? __bpf_trace_rcu_utilization+0xa/0xa
[  148.343377]  __ext4_journal_start_sb+0x316/0x3d6
[  148.348555]  ? call_filldir+0x3ea/0x3ea
[  148.352857]  ? do_raw_spin_unlock+0x4d/0x246
[  148.357648]  ? _raw_spin_unlock+0x7d/0xf6
[  148.362140]  ? _raw_spin_lock_bh+0x44/0x44
[  148.366737]  ext4_release_dquot+0x110/0x1aa
[  148.371422]  dqput+0x145/0x3ff
[  148.374850]  dqput_all+0x3f/0x52
[  148.378471]  __dquot_drop+0x1ad/0x202
[  148.382582]  ? dquot_drop+0x106/0x106
[  148.386693]  ? dquot_drop+0x9f/0x106
[  148.390703]  ext4_clear_inode+0x38/0x166
[  148.395105]  ext4_evict_inode+0x765/0xad9
[  148.399603]  ? lock_downgrade+0x601/0x601
[  148.404099]  ? ext4_truncate_restart_trans+0xd9/0xd9
[  148.409662]  ? do_raw_spin_unlock+0x4d/0x246
[  148.414448]  ? _raw_spin_unlock+0x7d/0xf6
[  148.418943]  ? _raw_spin_lock_bh+0x44/0x44
[  148.423539]  evict+0x25d/0x3da
[  148.426971]  dispose_list+0xfe/0x13f
[  148.430980]  prune_icache_sb+0x10f/0x175
[  148.435382]  ? invalidate_inodes+0x35a/0x35a
[  148.440173]  super_cache_scan+0x1fb/0x2c7
[  148.444664]  shrink_slab+0x6a2/0xb82
[  148.448679]  ? drop_slab_node+0x23/0x23
[  148.452985]  ? atomic_long_read+0x10/0x35
[  148.457482]  shrink_node+0xfcf/0x19e8
[  148.461603]  ? snapshot_refaults+0x48/0x48
[  148.466196]  ? inactive_list_is_low+0x406/0x536
[  148.471281]  ? pgdat_balanced+0xb1/0xdb
[  148.475580]  kswapd+0x1491/0x18ed
[  148.479309]  ? kswapd_run+0x164/0x164
[  148.483421]  ? _raw_spin_unlock+0xf6/0xf6
[  148.487915]  ? _raw_spin_lock_irqsave+0xc0/0xf2
[  148.492991]  ? init_wait_entry+0xd6/0xd6
[  148.497387]  ? __schedule+0xf52/0xf52
[  148.501496]  ? __kthread_parkme+0xc9/0x146
[  148.506090]  kthread+0x25c/0x271
[  148.509709]  ? kswapd_run+0x164/0x164
[  148.513816]  ? rcu_read_unlock_sched_notrace+0xca/0xca
[  148.519580]  ret_from_fork+0x3a/0x50

 
syzbot reported a similar problem: 
https://www.spinics.net/lists/linux-ext4/msg62212.html
Response from Jan Kara suggests that this may be a false positive. I don't really understand the code well enough to make my own conclusions. Leaving open for the time being, if for nothing else for tracking.

Sign in to add a comment