mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Fixed limit of inline files based on LFS_ATTR_MAX
The maximum limit of inline files and attributes are unrelated, but were not at a point in littlefs v2 development. This should be checking against the bit-field limit in the littlefs tag. Found by lsilvaalmeida
This commit is contained in:
		
							
								
								
									
										2
									
								
								lfs.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								lfs.c
									
									
									
									
									
								
							| @@ -2737,7 +2737,7 @@ lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file, | |||||||
|  |  | ||||||
|     if ((file->flags & LFS_F_INLINE) && |     if ((file->flags & LFS_F_INLINE) && | ||||||
|             lfs_max(file->pos+nsize, file->ctz.size) > |             lfs_max(file->pos+nsize, file->ctz.size) > | ||||||
|             lfs_min(LFS_ATTR_MAX, lfs_min( |             lfs_min(0x3fe, lfs_min( | ||||||
|                 lfs->cfg->cache_size, lfs->cfg->block_size/8))) { |                 lfs->cfg->cache_size, lfs->cfg->block_size/8))) { | ||||||
|         // inline file doesn't fit anymore |         // inline file doesn't fit anymore | ||||||
|         file->off = file->pos; |         file->off = file->pos; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user