mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Btrfs: Fix block generation verification race
After the path is released, the generation number got from block pointer is no long valid. The race may cause disk corruption, because verify_parent_transid() calls clear_extent_buffer_uptodate() when generation numbers mismatch. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
		
							parent
							
								
									46bfbb5c07
								
							
						
					
					
						commit
						5bdd3536cb
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1604,7 +1604,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
 | 
				
			||||||
	btrfs_release_path(NULL, p);
 | 
						btrfs_release_path(NULL, p);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = -EAGAIN;
 | 
						ret = -EAGAIN;
 | 
				
			||||||
	tmp = read_tree_block(root, blocknr, blocksize, gen);
 | 
						tmp = read_tree_block(root, blocknr, blocksize, 0);
 | 
				
			||||||
	if (tmp) {
 | 
						if (tmp) {
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
		 * If the read above didn't mark this buffer up to date,
 | 
							 * If the read above didn't mark this buffer up to date,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue