linux-hardened/fs/f2fs
Ritesh Harjani 02117b8ae9 f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read
Quota code itself is serializing the operations by taking mutex_lock.
It seems a below deadlock can happen if GF_NOFS is not used in
f2fs_quota_read

__switch_to+0x88
__schedule+0x5b0
schedule+0x78
schedule_preempt_disabled+0x20
__mutex_lock_slowpath+0xdc   		//mutex owner is itself
mutex_lock+0x2c
dquot_commit+0x30			//mutex_lock(&dqopt->dqio_mutex);
dqput+0xe0
__dquot_drop+0x80
dquot_drop+0x48
f2fs_evict_inode+0x218
evict+0xa8
dispose_list+0x3c
prune_icache_sb+0x58
super_cache_scan+0xf4
do_shrink_slab+0x208
shrink_slab.part.40+0xac
shrink_zone+0x1b0
do_try_to_free_pages+0x25c
try_to_free_pages+0x164
__alloc_pages_nodemask+0x534
do_read_cache_page+0x6c
read_cache_page+0x14
f2fs_quota_read+0xa4
read_blk+0x54
find_tree_dqentry+0xe4
find_tree_dqentry+0xb8
find_tree_dqentry+0xb8
find_tree_dqentry+0xb8
qtree_read_dquot+0x68
v2_read_dquot+0x24
dquot_acquire+0x5c			// mutex_lock(&dqopt->dqio_mutex);
dqget+0x238
__dquot_initialize+0xd4
dquot_initialize+0x10
dquot_file_open+0x34
f2fs_file_open+0x6c
do_dentry_open+0x1e4
vfs_open+0x6c
path_openat+0xa20
do_filp_open+0x4c
do_sys_open+0x178

Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2018-03-18 23:31:28 -07: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: flush cp pack except cp pack 2 page at first 2018-03-13 08:05:43 +09:00
data.c f2fs: add nowait aio support 2018-03-17 13:57:32 +09:00
debug.c f2fs: inject fault to kzalloc 2018-01-02 19:27:29 -08:00
dir.c f2fs: introduce a new mount option test_dummy_encryption 2018-03-17 14:02:57 +09:00
extent_cache.c f2fs: remove redundant initialization of pointer 'p' 2018-03-13 08:05:45 +09:00
f2fs.h f2fs: introduce a new mount option test_dummy_encryption 2018-03-17 14:02:57 +09:00
file.c f2fs: release locks before return in f2fs_ioc_gc_range() 2018-03-17 13:58:16 +09:00
gc.c f2fs: do gc in greedy mode for whole range if gc_urgent mode is set 2018-03-13 08:05:54 +09:00
gc.h f2fs: add an ioctl to disable GC for specific file 2018-01-22 14:56:35 -08:00
hash.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-04 11:44:35 -04:00
inline.c f2fs: don't put dentry page in pagecache into highmem 2018-03-13 08:05:03 +09:00
inode.c f2fs: remove unneeded set_cold_node() 2018-03-17 13:57:33 +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 f2fs: introduce a new mount option test_dummy_encryption 2018-03-17 14:02:57 +09:00
node.c f2fs: align memory boundary for bitops 2018-03-17 13:57:39 +09:00
node.h f2fs: remove unneeded set_cold_node() 2018-03-17 13:57:33 +09:00
recovery.c f2fs: fix to handle looped node chain during recovery 2018-03-13 08:05:40 +09:00
segment.c f2fs: wrap all options with f2fs_sb_info.mount_opt 2018-03-17 13:57:30 +09:00
segment.h f2fs: add auto tuning for small devices 2018-03-13 08:05:51 +09:00
shrinker.c f2fs: obsolete ALLOC_NID_LIST list 2017-10-10 12:49:53 -07:00
super.c f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read 2018-03-18 23:31:28 -07:00
sysfs.c f2fs: introduce F2FS_FEATURE_LOST_FOUND feature 2018-03-17 14:02:47 +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: correct removexattr behavior for null valued extended attribute 2018-01-22 14:56:57 -08:00
xattr.h f2fs: guard macro variables with braces 2017-04-10 19:48:10 -07:00