mirror of
				https://git.proxmox.com/git/mirror_zfs
				synced 2025-11-01 09:24:29 +00:00 
			
		
		
		
	Don't allow attach to a raidz child vdev
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Don Brady <don.brady@klarasystems.com> Closes #15536 Closes #15564
This commit is contained in:
		
							parent
							
								
									a94860a6de
								
							
						
					
					
						commit
						7bbd42ef49
					
				| @ -7063,12 +7063,13 @@ spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing, | ||||
| 
 | ||||
| 	if (!replacing) { | ||||
| 		/*
 | ||||
| 		 * For attach, the only allowable parent is a mirror or the root | ||||
| 		 * vdev. | ||||
| 		 * For attach, the only allowable parent is a mirror or | ||||
| 		 * the root vdev. A raidz vdev can be attached to, but | ||||
| 		 * you cannot attach to a raidz child. | ||||
| 		 */ | ||||
| 		if (pvd->vdev_ops != &vdev_mirror_ops && | ||||
| 		    pvd->vdev_ops != &vdev_raidz_ops && | ||||
| 		    pvd->vdev_ops != &vdev_root_ops) | ||||
| 		    pvd->vdev_ops != &vdev_root_ops && | ||||
| 		    !raidz) | ||||
| 			return (spa_vdev_exit(spa, newrootvd, txg, ENOTSUP)); | ||||
| 
 | ||||
| 		pvops = &vdev_mirror_ops; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Don Brady
						Don Brady