[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1638952658-20285-1-git-send-email-huangzhaoyang@gmail.com>
Date: Wed, 8 Dec 2021 16:37:38 +0800
From: Huangzhaoyang <huangzhaoyang@...il.com>
To: David Howells <dhowells@...hat.com>,
Marc Dionne <marc.dionne@...istor.com>,
Zhaoyang Huang <zhaoyang.huang@...soc.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] fs: judging context via current_is_kswapd instead of gfp_flag
From: Zhaoyang Huang <zhaoyang.huang@...soc.com>
Kswapd uses GFP_KERNEL as gfp_flag which make the judgment of
context is unexpected. fix it by using current_is_kswapd.
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@...soc.com>
---
fs/afs/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/afs/file.c b/fs/afs/file.c
index eb11d04..6c199d5 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -485,7 +485,7 @@ static int afs_releasepage(struct page *page, gfp_t gfp_flags)
* elected to wait */
#ifdef CONFIG_AFS_FSCACHE
if (PageFsCache(page)) {
- if (!(gfp_flags & __GFP_DIRECT_RECLAIM) || !(gfp_flags & __GFP_FS))
+ if (current_is_kswapd() || !(gfp_flags & __GFP_FS))
return false;
wait_on_page_fscache(page);
}
--
1.9.1
Powered by blists - more mailing lists