mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	linux/zvol_os: fix SET_ERROR with negative return codes
SET_ERROR is our facility for tracking errors internally. The negation is to match the what the kernel expects from us. Thus, the negation should happen outside of the SET_ERROR. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #16364
This commit is contained in:
		
							parent
							
								
									0172ee525b
								
							
						
					
					
						commit
						1f055436f3
					
				| @ -730,7 +730,7 @@ retry: | ||||
| #endif | ||||
| 	if (zv == NULL) { | ||||
| 		rw_exit(&zvol_state_lock); | ||||
| 		return (SET_ERROR(-ENXIO)); | ||||
| 		return (-SET_ERROR(ENXIO)); | ||||
| 	} | ||||
| 
 | ||||
| 	mutex_enter(&zv->zv_state_lock); | ||||
| @ -794,10 +794,10 @@ retry: | ||||
| 
 | ||||
| #ifdef HAVE_BLKDEV_GET_ERESTARTSYS | ||||
| 				schedule(); | ||||
| 				return (SET_ERROR(-ERESTARTSYS)); | ||||
| 				return (-SET_ERROR(ERESTARTSYS)); | ||||
| #else | ||||
| 				if ((gethrtime() - start) > timeout) | ||||
| 					return (SET_ERROR(-ERESTARTSYS)); | ||||
| 					return (-SET_ERROR(ERESTARTSYS)); | ||||
| 
 | ||||
| 				schedule_timeout(MSEC_TO_TICK(10)); | ||||
| 				goto retry; | ||||
| @ -819,7 +819,7 @@ retry: | ||||
| 			if (zv->zv_open_count == 0) | ||||
| 				zvol_last_close(zv); | ||||
| 
 | ||||
| 			error = SET_ERROR(-EROFS); | ||||
| 			error = -SET_ERROR(EROFS); | ||||
| 		} else { | ||||
| 			zv->zv_open_count++; | ||||
| 		} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Rob Norris
						Rob Norris