mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	Revert behavior of 59eab109 on not-Linux
				
					
				
			It turns out that short-circuiting the EFAULT behavior on a short read breaks things on FreeBSD. So until there's a nicer solution, let's just revert the behavior for not-Linux. Reference: https://reviews.freebsd.org/R10:70f51f0e474ffe1fb74cb427423a2fba3637544d Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #12698
This commit is contained in:
		
							parent
							
								
									2ef1ce66f5
								
							
						
					
					
						commit
						110d0ba5ca
					
				@ -254,7 +254,9 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ASSERT(zfs_uio_offset(uio) < zp->z_size);
 | 
			
		||||
#if defined(__linux__)
 | 
			
		||||
	ssize_t start_offset = zfs_uio_offset(uio);
 | 
			
		||||
#endif
 | 
			
		||||
	ssize_t n = MIN(zfs_uio_resid(uio), zp->z_size - zfs_uio_offset(uio));
 | 
			
		||||
	ssize_t start_resid = n;
 | 
			
		||||
 | 
			
		||||
@ -277,13 +279,18 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr)
 | 
			
		||||
			/* convert checksum errors into IO errors */
 | 
			
		||||
			if (error == ECKSUM)
 | 
			
		||||
				error = SET_ERROR(EIO);
 | 
			
		||||
 | 
			
		||||
#if defined(__linux__)
 | 
			
		||||
			/*
 | 
			
		||||
			 * if we actually read some bytes, bubbling EFAULT
 | 
			
		||||
			 * up to become EAGAIN isn't what we want here.
 | 
			
		||||
			 * up to become EAGAIN isn't what we want here...
 | 
			
		||||
			 *
 | 
			
		||||
			 * ...on Linux, at least. On FBSD, doing this breaks.
 | 
			
		||||
			 */
 | 
			
		||||
			if (error == EFAULT &&
 | 
			
		||||
			    (zfs_uio_offset(uio) - start_offset) != 0)
 | 
			
		||||
				error = 0;
 | 
			
		||||
#endif
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user