Bug 216562
Summary: | ubifs: Bad budget calculation for journal head | ||
---|---|---|---|
Product: | File System | Reporter: | Zhihao Cheng (chengzhihao1) |
Component: | Other | Assignee: | fs_other |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.10 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
setup.sh
diff error_log |
Description
Zhihao Cheng
2022-10-09 11:14:46 UTC
Created attachment 302962 [details]
setup.sh
Created attachment 302963 [details]
diff
Created attachment 302964 [details]
error_log
UBIFS calculates available space by c->main_bytes - c->lst.total_used (which means free and dirty non-index space are accounted into total available), then index lebs and four lebs (one for gc_lnum, one for deletions, two for journal heads) are deducted. All lebs's space information are displayed in error_log: LEB 84: DATAHD free 122880 used 1920 dirty 2176 dark 6144 LEB 110:DELETION free 126976 used 0 dirty 0 dark 6144 (empty) LEB 201:gc_lnum free 126976 used 0 dirty 0 dark 6144 LEB 272:GCHD free 77824 used 47672 dirty 1480 dark 6144 LEB 356:BASEHD free 0 used 39776 dirty 87200 dark 6144 OTHERS: index lebs, zero-available non-index lebs total_available: (5 - 4) * 126976 - 1920 - 47672 - 39776 - 6144 * 5 = 6888 However UBIFS cannot use BASEHD's dirty space(87200), because UBIFS can no longer get any lebs to gc (c->bi.min_idx_lebs equals to c->lst.idx_lebs, dirty index lebs won't be picked as gced lebs. All non-index lebs has dirty space less then c->dead_wm, non-index lebs won't be picked as gced lebs either). So, ubifs should reserve one leb for each journal head while doing budget. |