mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Stop wear-leveling during migration
Stop proactively relocate blocks during migrations, this can cause a number of failure states such: clobbering the v1 superblock if we relocate root, and invalidating directory pointers if we relocate the head of a directory. On top of this, relocations increase the overall complexity of lfs_migration, which is already a delicate operation.
This commit is contained in:
		
							
								
								
									
										10
									
								
								lfs.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								lfs.c
									
									
									
									
									
								
							| @@ -1503,9 +1503,13 @@ static int lfs_dir_compact(lfs_t *lfs, | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| #ifdef LFS_MIGRATE | #ifdef LFS_MIGRATE | ||||||
|         } else if (lfs_pair_cmp(dir->pair, lfs->root) == 0 && lfs->lfs1) { |         } else if (lfs->lfs1) { | ||||||
|             // we can't relocate our root during migrations, as this would |             // do not proactively relocate blocks during migrations, this | ||||||
|             // cause the superblock to get updated, which would clobber v1 |             // can cause a number of failure states such: clobbering the | ||||||
|  |             // v1 superblock if we relocate root, and invalidating directory | ||||||
|  |             // pointers if we relocate the head of a directory. On top of | ||||||
|  |             // this, relocations increase the overall complexity of | ||||||
|  |             // lfs_migration, which is already a delicate operation. | ||||||
| #endif | #endif | ||||||
|         } else { |         } else { | ||||||
|             // we're writing too much, time to relocate |             // we're writing too much, time to relocate | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user