-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathremove-mount-check.patch
31 lines (28 loc) · 1.32 KB
/
remove-mount-check.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- lfs.c 2025-04-14 12:03:45.959258416 +0200
+++ lfs.c.patched 2025-04-14 12:03:23.044370382 +0200
@@ -4521,15 +4521,20 @@
}
// this is where we get the block_count from disk if block_count=0
- if (lfs->cfg->block_count
- && superblock.block_count != lfs->cfg->block_count) {
- LFS_ERROR("Invalid block count (%"PRIu32" != %"PRIu32")",
- superblock.block_count, lfs->cfg->block_count);
- err = LFS_ERR_INVAL;
- goto cleanup;
- }
+ //
+ // if (lfs->cfg->block_count
+ // && superblock.block_count != lfs->cfg->block_count) {
+ // LFS_ERROR("Invalid block count (%"PRIu32" != %"PRIu32")",
+ // superblock.block_count, lfs->cfg->block_count);
+ // err = LFS_ERR_INVAL;
+ // goto cleanup;
+ // }
- lfs->block_count = superblock.block_count;
+ if (lfs->cfg->block_count) {
+ lfs->block_count = lfs->cfg->block_count;
+ } else {
+ lfs->block_count = superblock.block_count;
+ }
if (superblock.block_size != lfs->cfg->block_size) {
LFS_ERROR("Invalid block size (%"PRIu32" != %"PRIu32")",