mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	libceph: report socket read/write error message
We need to set error_msg to something useful before calling ceph_fault();
do so here for try_{read,write}().  This is more informative than
libceph: osd0 192.168.106.220:6801 (null)
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
			
			
This commit is contained in:
		
							parent
							
								
									546f04ef71
								
							
						
					
					
						commit
						3a140a0d5c
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -2287,14 +2287,18 @@ static void con_work(struct work_struct *work)
 | 
			
		|||
	ret = try_read(con);
 | 
			
		||||
	if (ret == -EAGAIN)
 | 
			
		||||
		goto restart;
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
	if (ret < 0) {
 | 
			
		||||
		con->error_msg = "socket error on read";
 | 
			
		||||
		goto fault;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ret = try_write(con);
 | 
			
		||||
	if (ret == -EAGAIN)
 | 
			
		||||
		goto restart;
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
	if (ret < 0) {
 | 
			
		||||
		con->error_msg = "socket error on write";
 | 
			
		||||
		goto fault;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
done:
 | 
			
		||||
	mutex_unlock(&con->mutex);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue