mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	gfs2: retry interrupted internal reads
The iomap-based read operations done by gfs2 for its system files, such as rindex, may sometimes be interrupted and return -EINTR. This confuses some users of gfs2_internal_read(). Fix that by retrying interrupted reads. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
		
							parent
							
								
									6fa0a72cbb
								
							
						
					
					
						commit
						cea44032bc
					
				
					 1 changed files with 7 additions and 4 deletions
				
			
		| 
						 | 
					@ -491,13 +491,16 @@ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos,
 | 
				
			||||||
	void *p;
 | 
						void *p;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
 | 
							page = read_cache_page(mapping, index, gfs2_read_folio, NULL);
 | 
				
			||||||
 | 
							if (IS_ERR(page)) {
 | 
				
			||||||
 | 
								if (PTR_ERR(page) == -EINTR)
 | 
				
			||||||
 | 
									continue;
 | 
				
			||||||
 | 
								return PTR_ERR(page);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							p = kmap_atomic(page);
 | 
				
			||||||
		amt = size - copied;
 | 
							amt = size - copied;
 | 
				
			||||||
		if (offset + size > PAGE_SIZE)
 | 
							if (offset + size > PAGE_SIZE)
 | 
				
			||||||
			amt = PAGE_SIZE - offset;
 | 
								amt = PAGE_SIZE - offset;
 | 
				
			||||||
		page = read_cache_page(mapping, index, gfs2_read_folio, NULL);
 | 
					 | 
				
			||||||
		if (IS_ERR(page))
 | 
					 | 
				
			||||||
			return PTR_ERR(page);
 | 
					 | 
				
			||||||
		p = kmap_atomic(page);
 | 
					 | 
				
			||||||
		memcpy(buf + copied, p + offset, amt);
 | 
							memcpy(buf + copied, p + offset, amt);
 | 
				
			||||||
		kunmap_atomic(p);
 | 
							kunmap_atomic(p);
 | 
				
			||||||
		put_page(page);
 | 
							put_page(page);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue