mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	Don't attempt trimming "hole" vdevs
On zpools containing hole vdevs (e.g. removed log devices), the `zpool trim` (and presumably `zpool initialize`) commands will attempt calling their respective functions on "hole", which fails, as this is not a real vdev. Avoid this by removing HOLE vdevs in zpool_collect_leaves. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Niklas Haas <git@haasn.xyz> Closes #10227
This commit is contained in:
		
							parent
							
								
									1f043c8be1
								
							
						
					
					
						commit
						a84c92f933
					
				| @ -445,7 +445,8 @@ zpool_collect_leaves(zpool_handle_t *zhp, nvlist_t *nvroot, nvlist_t *res) | |||||||
| 		char *path = zpool_vdev_name(g_zfs, zhp, nvroot, | 		char *path = zpool_vdev_name(g_zfs, zhp, nvroot, | ||||||
| 		    VDEV_NAME_PATH); | 		    VDEV_NAME_PATH); | ||||||
| 
 | 
 | ||||||
| 		if (strcmp(path, VDEV_TYPE_INDIRECT) != 0) | 		if (strcmp(path, VDEV_TYPE_INDIRECT) != 0 && | ||||||
|  | 		    strcmp(path, VDEV_TYPE_HOLE) != 0) | ||||||
| 			fnvlist_add_boolean(res, path); | 			fnvlist_add_boolean(res, path); | ||||||
| 
 | 
 | ||||||
| 		free(path); | 		free(path); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Niklas Haas
						Niklas Haas