mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	bcachefs: Fix truncate sometimes failing and returning 1
__bch_truncate_folio() may return 1 to indicate dirtyness of the folio being truncated, needed for fpunch to get the i_size writes correct. But truncate was forgetting to clear ret, and sometimes returning it as an error. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
		
							parent
							
								
									677bdb7346
								
							
						
					
					
						commit
						eb54d2695b
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -466,6 +466,7 @@ int bchfs_truncate(struct mnt_idmap *idmap,
 | 
				
			||||||
	ret = bch2_truncate_folio(inode, iattr->ia_size);
 | 
						ret = bch2_truncate_folio(inode, iattr->ia_size);
 | 
				
			||||||
	if (unlikely(ret < 0))
 | 
						if (unlikely(ret < 0))
 | 
				
			||||||
		goto err;
 | 
							goto err;
 | 
				
			||||||
 | 
						ret = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	truncate_setsize(&inode->v, iattr->ia_size);
 | 
						truncate_setsize(&inode->v, iattr->ia_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue