lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 08 Dec 2021 20:26:46 +0000
From:   David Howells <dhowells@...hat.com>
To:     Huangzhaoyang <huangzhaoyang@...il.com>
Cc:     dhowells@...hat.com, Marc Dionne <marc.dionne@...istor.com>,
        Zhaoyang Huang <zhaoyang.huang@...soc.com>,
        linux-cachefs@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: judging context via current_is_kswapd instead of gfp_flag

Huangzhaoyang <huangzhaoyang@...il.com> wrote:

[adding linux-cachefs to the cc list]

> 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);
>  	}

I have several of these in my fscache-rewrite branch, spread across a number
of filesystems.  Should I fix all of them the same way?

fs/9p/vfs_addr.c:               if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS))
fs/afs/file.c:          if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS))
fs/nfs/file.c:          if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS))
fs/nfs/fscache.h:               if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS))

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ