mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	Revert "Report holes when there are only metadata changes"
This reverts commit ec4f9b8f30 which introduced a narrow race which
can lead to lseek(, SEEK_DATA) incorrectly returning ENXIO.  Resolve
the issue by revering this change to restore the previous behavior
which depends solely on checking the dirty list.
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8816 
Closes #8834
			
			
This commit is contained in:
		
							parent
							
								
									94866d8309
								
							
						
					
					
						commit
						4f8eef29e0
					
				| @ -2373,40 +2373,15 @@ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off) | |||||||
| 		return (err); | 		return (err); | ||||||
| 
 | 
 | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * Check if there are dirty data blocks or frees which have not been | 	 * Check if dnode is dirty | ||||||
| 	 * synced.  Dirty spill and bonus blocks which are external to the |  | ||||||
| 	 * object can ignored when reporting holes. |  | ||||||
| 	 */ | 	 */ | ||||||
| 	mutex_enter(&dn->dn_mtx); |  | ||||||
| 	for (i = 0; i < TXG_SIZE; i++) { | 	for (i = 0; i < TXG_SIZE; i++) { | ||||||
| 		if (multilist_link_active(&dn->dn_dirty_link[i])) { | 		if (multilist_link_active(&dn->dn_dirty_link[i])) { | ||||||
| 
 |  | ||||||
| 			if (dn->dn_free_ranges[i] != NULL) { |  | ||||||
| 				clean = B_FALSE; |  | ||||||
| 				break; |  | ||||||
| 			} |  | ||||||
| 
 |  | ||||||
| 			list_t *list = &dn->dn_dirty_records[i]; |  | ||||||
| 			dbuf_dirty_record_t *dr; |  | ||||||
| 
 |  | ||||||
| 			for (dr = list_head(list); dr != NULL; |  | ||||||
| 			    dr = list_next(list, dr)) { |  | ||||||
| 				dmu_buf_impl_t *db = dr->dr_dbuf; |  | ||||||
| 
 |  | ||||||
| 				if (db->db_blkid == DMU_SPILL_BLKID || |  | ||||||
| 				    db->db_blkid == DMU_BONUS_BLKID) |  | ||||||
| 					continue; |  | ||||||
| 
 |  | ||||||
| 			clean = B_FALSE; | 			clean = B_FALSE; | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 		if (clean == B_FALSE) |  | ||||||
| 			break; |  | ||||||
| 	} |  | ||||||
| 	mutex_exit(&dn->dn_mtx); |  | ||||||
| 
 |  | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * If compatibility option is on, sync any current changes before | 	 * If compatibility option is on, sync any current changes before | ||||||
| 	 * we go trundling through the block pointers. | 	 * we go trundling through the block pointers. | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Brian Behlendorf
						Brian Behlendorf