mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	lightnvm: pblk: recover only written metadata
This patch ensures that smeta was fully written before even trying to read it based on chunk table state and write pointer. Signed-off-by: Igor Konopko <igor.j.konopko@intel.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
		
							parent
							
								
									3e03f6322a
								
							
						
					
					
						commit
						a24eab5988
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -655,10 +655,12 @@ static int pblk_line_was_written(struct pblk_line *line, | |||
| 	bppa = pblk->luns[smeta_blk].bppa; | ||||
| 	chunk = &line->chks[pblk_ppa_to_pos(geo, bppa)]; | ||||
| 
 | ||||
| 	if (chunk->state & NVM_CHK_ST_FREE) | ||||
| 		return 0; | ||||
| 	if (chunk->state & NVM_CHK_ST_CLOSED || | ||||
| 	    (chunk->state & NVM_CHK_ST_OPEN | ||||
| 	     && chunk->wp >= lm->smeta_sec)) | ||||
| 		return 1; | ||||
| 
 | ||||
| 	return 1; | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
| static bool pblk_line_is_open(struct pblk *pblk, struct pblk_line *line) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Igor Konopko
						Igor Konopko