linux/fs/f2fs
Jaegeuk Kim a1933c09ef f2fs: avoid potential deadlock in f2fs_sbi_store
[  155.018460] ======================================================
[  155.021431] WARNING: possible circular locking dependency detected
[  155.024339] 4.18.0-rc3+ #5 Tainted: G           OE
[  155.026879] ------------------------------------------------------
[  155.029783] umount/2901 is trying to acquire lock:
[  155.032187] 00000000c4282f1f (kn->count#130){++++}, at: kernfs_remove+0x1f/0x30
[  155.035439]
[  155.035439] but task is already holding lock:
[  155.038892] 0000000056e4307b (&type->s_umount_key#41){++++}, at: deactivate_super+0x33/0x50
[  155.042602]
[  155.042602] which lock already depends on the new lock.
[  155.042602]
[  155.047465]
[  155.047465] the existing dependency chain (in reverse order) is:
[  155.051354]
[  155.051354] -> #1 (&type->s_umount_key#41){++++}:
[  155.054768]        f2fs_sbi_store+0x61/0x460 [f2fs]
[  155.057083]        kernfs_fop_write+0x113/0x1a0
[  155.059277]        __vfs_write+0x36/0x180
[  155.061250]        vfs_write+0xbe/0x1b0
[  155.063179]        ksys_write+0x55/0xc0
[  155.065068]        do_syscall_64+0x60/0x1b0
[  155.067071]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  155.069529]
[  155.069529] -> #0 (kn->count#130){++++}:
[  155.072421]        __kernfs_remove+0x26f/0x2e0
[  155.074452]        kernfs_remove+0x1f/0x30
[  155.076342]        kobject_del.part.5+0xe/0x40
[  155.078354]        f2fs_put_super+0x12d/0x290 [f2fs]
[  155.080500]        generic_shutdown_super+0x6c/0x110
[  155.082655]        kill_block_super+0x21/0x50
[  155.084634]        kill_f2fs_super+0x9c/0xc0 [f2fs]
[  155.086726]        deactivate_locked_super+0x3f/0x70
[  155.088826]        cleanup_mnt+0x3b/0x70
[  155.090584]        task_work_run+0x93/0xc0
[  155.092367]        exit_to_usermode_loop+0xf0/0x100
[  155.094466]        do_syscall_64+0x162/0x1b0
[  155.096312]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  155.098603]
[  155.098603] other info that might help us debug this:
[  155.098603]
[  155.102418]  Possible unsafe locking scenario:
[  155.102418]
[  155.105134]        CPU0                    CPU1
[  155.107037]        ----                    ----
[  155.108910]   lock(&type->s_umount_key#41);
[  155.110674]                                lock(kn->count#130);
[  155.113010]                                lock(&type->s_umount_key#41);
[  155.115608]   lock(kn->count#130);

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2018-07-27 18:03:59 +09:00
..
acl.c posix_acl: convert posix_acl.a_refcount from atomic_t to refcount_t 2018-01-02 19:27:28 -08:00
acl.h f2fs: remove dead code f2fs_check_acl 2016-09-14 16:52:36 -07:00
checkpoint.c f2fs: indicate shutdown f2fs to allow unmount successfully 2018-07-27 18:03:56 +09:00
data.c f2fs: allow wrong configured dio to buffered write 2018-07-15 12:14:04 +09:00
debug.c f2fs: avoid stucking GC due to atomic write 2018-05-31 11:31:51 -07:00
dir.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
extent_cache.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
f2fs.h f2fs: indicate shutdown f2fs to allow unmount successfully 2018-07-27 18:03:56 +09:00
file.c f2fs: indicate shutdown f2fs to allow unmount successfully 2018-07-27 18:03:56 +09:00
gc.c f2fs: let sync node IO interrupt async one 2018-06-04 14:33:20 -07:00
gc.h f2fs: introduce sbi->gc_mode to determine the policy 2018-05-31 11:31:51 -07:00
hash.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-04 11:44:35 -04:00
inline.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
inode.c f2fs: indicate shutdown f2fs to allow unmount successfully 2018-07-27 18:03:56 +09:00
Kconfig fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at 2018-01-01 12:45:37 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
node.c f2fs: indicate shutdown f2fs to allow unmount successfully 2018-07-27 18:03:56 +09:00
node.h f2fs: don't track new nat entry in nat set 2018-03-27 20:10:29 -07:00
recovery.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
segment.c treewide: Use array_size in f2fs_kvzalloc() 2018-06-12 16:19:22 -07:00
segment.h f2fs: fix to update mtime correctly 2018-06-04 14:31:11 -07:00
shrinker.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
super.c f2fs: indicate shutdown f2fs to allow unmount successfully 2018-07-27 18:03:56 +09:00
sysfs.c f2fs: avoid potential deadlock in f2fs_sbi_store 2018-07-27 18:03:59 +09:00
trace.c f2fs: fix potential hangtask in f2fs_trace_pid 2018-01-02 19:27:30 -08:00
trace.h f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
xattr.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
xattr.h f2fs: guard macro variables with braces 2017-04-10 19:48:10 -07:00