Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aa3b3e0 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Jan Kara
Browse files

fs: quota: Replace GFP_ATOMIC with GFP_KERNEL in dquot_init



dquot_init() is never called in atomic context.
This function is only set as a parameter of fs_initcall().

Despite never getting called from atomic context,
dquot_init() calls __get_free_pages() with GFP_ATOMIC,
which waits busily for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
to avoid busy waiting and improve the possibility of sucessful allocation.

This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.

Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 54a307ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2966,7 +2966,7 @@ static int __init dquot_init(void)
			NULL);

	order = 0;
	dquot_hash = (struct hlist_head *)__get_free_pages(GFP_ATOMIC, order);
	dquot_hash = (struct hlist_head *)__get_free_pages(GFP_KERNEL, order);
	if (!dquot_hash)
		panic("Cannot create dquot hash table");