mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	ext4: Fix block zeroing when punching holes in indirect block files
free_holes_block() passed local variable as a block pointer to ext4_clear_blocks(). Thus ext4_clear_blocks() zeroed out this local variable instead of proper place in inode / indirect block. We later zero out proper place in inode / indirect block but don't dirty the inode / buffer again which can lead to subtle issues (some changes e.g. to inode can be lost). Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
		
							parent
							
								
									e43bb4e612
								
							
						
					
					
						commit
						77ea2a4ba6
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1335,8 +1335,8 @@ static int free_hole_blocks(handle_t *handle, struct inode *inode, | ||||||
| 		if (level == 0 || | 		if (level == 0 || | ||||||
| 		    (bh && all_zeroes((__le32 *)bh->b_data, | 		    (bh && all_zeroes((__le32 *)bh->b_data, | ||||||
| 				      (__le32 *)bh->b_data + addr_per_block))) { | 				      (__le32 *)bh->b_data + addr_per_block))) { | ||||||
| 			ext4_free_data(handle, inode, parent_bh, &blk, &blk+1); | 			ext4_free_data(handle, inode, parent_bh, | ||||||
| 			*i_data = 0; | 				       i_data, i_data + 1); | ||||||
| 		} | 		} | ||||||
| 		brelse(bh); | 		brelse(bh); | ||||||
| 		bh = NULL; | 		bh = NULL; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jan Kara
						Jan Kara