mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	f2fs: clear PageError on the read path
When running fault injection test, I hit somewhat wrong behavior in f2fs_gc ->
gc_data_segment():
0. fault injection generated some PageError'ed pages
1. gc_data_segment
 -> f2fs_get_read_data_page(REQ_RAHEAD)
2. move_data_page
 -> f2fs_get_lock_data_page()
  -> f2f_get_read_data_page()
   -> f2fs_submit_page_read()
    -> submit_bio(READ)
  -> return EIO due to PageError
  -> fail to move data
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									f847c699cf
								
							
						
					
					
						commit
						fb7d70db30
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -77,7 +77,8 @@ static void __read_end_io(struct bio *bio)
 | 
			
		|||
		/* PG_error was set if any post_read step failed */
 | 
			
		||||
		if (bio->bi_status || PageError(page)) {
 | 
			
		||||
			ClearPageUptodate(page);
 | 
			
		||||
			SetPageError(page);
 | 
			
		||||
			/* will re-read again later */
 | 
			
		||||
			ClearPageError(page);
 | 
			
		||||
		} else {
 | 
			
		||||
			SetPageUptodate(page);
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -591,6 +592,7 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page,
 | 
			
		|||
		bio_put(bio);
 | 
			
		||||
		return -EFAULT;
 | 
			
		||||
	}
 | 
			
		||||
	ClearPageError(page);
 | 
			
		||||
	__submit_bio(F2FS_I_SB(inode), bio, DATA);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1579,6 +1581,7 @@ static int f2fs_mpage_readpages(struct address_space *mapping,
 | 
			
		|||
		if (bio_add_page(bio, page, blocksize, 0) < blocksize)
 | 
			
		||||
			goto submit_and_realloc;
 | 
			
		||||
 | 
			
		||||
		ClearPageError(page);
 | 
			
		||||
		last_block_in_bio = block_nr;
 | 
			
		||||
		goto next_page;
 | 
			
		||||
set_error_page:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue