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] [day] [month] [year] [list]
Date:	Sat, 21 Jul 2012 11:57:41 -0500
From:	Jonathan Nieder <jrnieder@...il.com>
To:	David Howells <dhowells@...hat.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
	linux-cachefs@...hat.com, linux-kernel@...r.kernel.org,
	Jeff Layton <jlayton@...hat.com>
Subject: Re: [PATCH 17/17] NFS: nfs_migrate_page() does not wait for FS-Cache
 to finish with a page

Hi,

In February, David Howells wrote:

> nfs_migrate_page() does not wait for FS-Cache to finish with a page, probably
> leading to the following bad-page-state:
[...]
> nfs_migrate_page() calls nfs_fscache_release_page() which doesn't actually wait
> - even if __GFP_WAIT is set.  The reason that doesn't wait is that
> fscache_maybe_release_page() might deadlock the allocator as the work threads
> writing to the cache may all end up sleeping on memory allocation.
[...]
>  (1) Make nfs_migrate_page() wait.
>
>  (2) Make fscache_maybe_release_page() honour the __GFP_WAIT flag.
>
>  (3) Set a timeout around the wait.
>
>  (4) Make nfs_migrate_page() return an error if the page is still busy.
>
> For the moment, I'll select (2) and (4).
[...]
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1701,7 +1701,9 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
>  	if (PagePrivate(page))
>  		return -EBUSY;
>  
> -	nfs_fscache_release_page(page, GFP_KERNEL);
> +	ret = -EBUSY;
> +	if (!nfs_fscache_release_page(page, GFP_KERNEL))
> +		goto out;
>  
>  	return migrate_page(mapping, newpage, page, mode);
>  }

Small thing, but it looks like this was forward-ported incorrectly.
Was this ever tested with CONFIG_MIGRATION enabled?

Hope that helps,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ