forked from mirrors/linux
		
	NFS: fix up nfs_release_folio() to try to release the page
If the gfp context allows it, and we're not kswapd, then try to write out the folio that has private data. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
		
							parent
							
								
									70e9db69f9
								
							
						
					
					
						commit
						96780ca55e
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -432,8 +432,13 @@ static bool nfs_release_folio(struct folio *folio, gfp_t gfp) | ||||||
| 	dfprintk(PAGECACHE, "NFS: release_folio(%p)\n", folio); | 	dfprintk(PAGECACHE, "NFS: release_folio(%p)\n", folio); | ||||||
| 
 | 
 | ||||||
| 	/* If the private flag is set, then the folio is not freeable */ | 	/* If the private flag is set, then the folio is not freeable */ | ||||||
| 	if (folio_test_private(folio)) | 	if (folio_test_private(folio)) { | ||||||
|  | 		if ((current_gfp_context(gfp) & GFP_KERNEL) != GFP_KERNEL || | ||||||
|  | 		    current_is_kswapd()) | ||||||
| 			return false; | 			return false; | ||||||
|  | 		if (nfs_wb_folio(folio_file_mapping(folio)->host, folio) < 0) | ||||||
|  | 			return false; | ||||||
|  | 	} | ||||||
| 	return nfs_fscache_release_folio(folio, gfp); | 	return nfs_fscache_release_folio(folio, gfp); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Trond Myklebust
						Trond Myklebust