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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
|
# Changelog
## v1.39.7 - Sun Oct 4 2026
### Major changes:
#### Disk accounting now has replication level fully plumbed
Previously, on a filesystem with mismatched device sizes or severely mismatched
free space, a write would be allowed when we could only write degraded (and not
running in degraded mode). Now, those writes will properly return -ENOSPC.
Disk reservations are now taken at a replica count, and the allocator
knows how much it can place at each one - how much we can write *now*, as
distinct from how much we could reserve. `bcachefs fs usage` shows free
space by replica count (via the new `BCH_IOCTL_QUERY_ACCOUNTING_v2`), and
statfs never reports more than a reservation could actually get. The
copygc reserve is now per device.
New option `write_degraded`: whether to write fewer copies than asked for
rather than returning ENOSPC. The default, `degraded`, does so only while a
device is missing or not read-write; `yes` always, `no` never.
A write that lands with fewer replicas than it asked for is no longer
silent (GH #1221): it's recorded in the superblock error list
(`write_degraded_insufficient_devices`, `write_degraded_no_progress`), and
reservations granted at a lower count show up in `fs top` as
`disk_reservation_degraded`.
#### FUSE mount
`bcachefs mount -o fuse` mounts through the FUSE daemon, which grew significant
new functionality: subvolumes (".." of a subvolume root is in the parent),
extended attributes, multiple worker threads, `allow_other` with the kernel
checking permissions, file handles that survive the inode cache, fsync,
fsyncdir and syncfs, new inodes owned by the caller, atime/mtime/ctime
updates, times before 1970, writes refused on read-only snapshots, rename
over an existing name, unlinked-but-open inodes deleted on last close, and
statfs in the right units. Block devices mount as `fuseblk` so umount waits
for shutdown, the daemon gets its own systemd scope, and a second
filesystem never starts on a device in use.
FUSE mode is now being tested in the CI with the full xfstests suite. It's
important to note that given the constraints of the kernel FUSE interface, FUSE
will never be competitive with in-kernel bcachefs on performance or have a 100%
complete featureset; the goal here is to make it a solid and well tested
recovery option.
#### Boot
A dracut module. The systemd generator reads the fstabs systemd reads in an
initrd, and the `sd-bcachefs` mkinitcpio hook now relies on it for the root.
#### Journal scrub
Journal scrub scrubs from the flush before last_seq, checks btree nodes
written in the window, reports bad replicas it repaired from good ones,
and queues read failures instead of committing damage. Recovery starts the
journal after the scrub.
### Bugfixes
- Checksum narrowing never ran: `can_narrow_crc()`'s test was reversed
(Alan Derk). Narrowing could also outgrow the entry's nonce field.
- Erasure coding:
- a stripe reuse that can't reconstruct records damage only for the
extents that fail their own checksums, not every extent in the block
- stripe repair evacuates the bad blocks first, counts only devices that
can take a block, and reserves its parity when narrowing; a stripe it
can't repair yet is parked instead of ending the reconcile thread
- scrub checks stripe blocks against the stripe's checksums; a block on a
durability 0 device counts as bad
- transient allocation failures no longer park extents
- stripe reuse reads only the blocks it carries (Alan Derk)
- opening an existing stripe invalidates stale "not open" decisions
(tom-doerr); open buckets leaked when stripe repair failed (daniron26)
- Superblocks: a bad primary is rewritten when we read from a backup.
`key set-passphrase` and `remove-passphrase` actually write the
superblock and ask for the passphrase once; offline edits persist the
edit, not the open's version decisions. Resize marks the superblock
buckets the new range brings in, and fsck drops data pointers into
superblock buckets.
- Emergency shutdown: reservations fail with EROFS, waiting on the
allocator is an error, and shared writable mmaps are refused.
- Written-but-open buckets were subtracted from free space twice: with one
member ro or offline under sustained writes, writes and sync could hang
on an array far from full (GH #917, daniron26).
- `device set-state ro` without `--force` could leave fewer rw devices than
`--replicas`, and new writes landed with one copy; the check had been
dead since a two-step regression (daniron26).
- A recovery pass that failed wasn't retried for 100x its runtime - one
transient failure could leave snapshot deletion unscheduled for most of a
day (tools #941). The backoff is now exponential in consecutive failures,
capped at 20x, and resets on success.
- fsck resurrected subvolumes waiting on deletion into lost+found - with
podman on a full filesystem, dozens of deleted image layers (reported by
ticpu).
- A partial hole punch in a snapshot child could let the parent's data
reappear after remount (Matthias Goergens).
- The btree write buffer could expose staged keys without a journal pin
when growing its array failed (Matthias Goergens).
- Freezing: the write buffer flush workqueue and reconcile workers are
freezable, and moves in flight are frozen rather than flushed.
- Setting a device ro, evacuating or spare writes out dirty data first: on
a full filesystem, shrinking capacity under dirty pagecache's
reservations left sync waiting forever. Evacuate says when it stops
making progress.
- A durability change scans the device that changed, not device 0 (Alan
Derk).
- Encrypted mounts through the mount(2) fallback find the key in a fresh
session that doesn't link the user keyring (tools #640, Darafei
Praliaskouski).
- `set-fs-option --rotational=` persists even when it matches the detected
value, so a later rediscovery can't override an explicit choice (tools
#594, Darafei Praliaskouski).
- rmdir in a casefolded directory could deadlock against the last close of
a removed subdirectory.
No metadata version change.
## v1.39.6 - Fri Sep 11 2026
An early release for an erasure coding regression in 1.39.5: stripe reuse moved
in front of allocation, and any error from reuse - including "nothing to reuse
right now" - aborted stripe creation. `ec_alloc_failed` is ENOSPC class, so the
extent was parked on the reconcile pending list, which nothing retries, and
pending climbed without bound while converting to EC. Reported by ChH.
Also fixes the i386 and ppc64le builds.
### Bugfixes
- Fix the i386 build: bindgen's union emulation is 4 byte aligned on i686 where
the C type is 8, so bindgen's own layout assertion couldn't hold (#905)
- Fix ppc64le, where most ioctls had returned ENOTTY since 1.36 - the opcodes
were computed in Rust from asm-generic's layout instead of asked of the C
compiler (#904, reported by logan2611)
- Fix a panic creating a stripe with a read-only member, where the carry-forward
fold could still be in flight at teardown (reported, diagnosed and fixed by
i7920c0)
- Fix a BUG_ON in topology repair, which dropped the root without un-rooting it
first (#903)
- Transaction restarts in the `must_ec` probe were collapsed to
`ec_alloc_failed` and parked as permanent
- copygc counts buckets queued for evacuation: on a device it was already
working the old fragmentation test was noise, and writers blocked in the
allocator spun on `transaction_restart_nested`
- Stripe reuse engages before copygc has to run, not after - 12 devices at 10+2
settle at 83% full instead of 87%, for 8% more device writes
- Erasure coding reports why it didn't happen instead of a bare
`ec_alloc_failed`, and the extent parks that weren't traced now emit
`reconcile_set_pending`
No metadata version change.
## v1.39.5 - Mon Sep 7 2026
Mostly about knowing what you lost: damage from a repair is recorded against
the files that lost data, and the recovery tools stopped inventing data they
never read.
### Features
#### Damage tracking
When a repair costs data, what was lost is now recorded against the file that
lost it, in the same transaction as the repair that did the damage.
`bcachefs damage <file>` reports what a file lost. `bcachefs damage ls [-R]`
lists the damaged files in a directory, so "what did that fsck actually cost
me" is a question with an answer. `bcachefs damage clear` drops the record once
you've dealt with it - it needs ownership of the file, like `chattr`, and
snapshots keep their own view of what was damaged.
The cases covered: fsck dropping a pointer that was the last replica, fsck
dropping a replica that failed its checksum, extent ranges under a btree node
that couldn't be read, a stripe reuse that couldn't read the old blocks, and
forced device removal killing a stripe. Data update reads record against the
file too, so a move that reads bad data leaves a record and not just a log
line.
Stripe read checksum errors and reconstruct failures are counted separately -
"it came back wrong" and "it couldn't be reconstructed" are different problems.
#### Options on snapshotted files
Setting an io option on a file that had been snapshotted did nothing to the
data written before the snapshot. Reported by nephyrin: setting
`background_compression` on a snapshotted file had no effect at all, and
deleting the snapshot made it start working.
The reason is that an extent takes its io options from the inode version at the
nearest ancestor of the snapshot it was written at - so an option set in a
branch never reached data written before that branch existed. The snapshot had
preserved an inode version with the old options, and reconcile was reading
those.
Setting an option now pushes it up to the ancestor versions that the older data
reads from. It runs as a logged op - one inode at one ancestor per commit - so
a deep snapshot chain doesn't blow up a transaction, and a climb that has begun
finishes across a crash. Conflicts between branches are resolved rather than
left, and fsck checks that options reached their ancestors.
### Bugfixes
- Arch: there's an `sd-bcachefs` mkinitcpio hook now, for booting a bcachefs
root from the systemd initramfs rather than the busybox one. It pulls in the
module, the binary, `systemd-ask-password`, the mount generator and the udev
rule; add `sd-encrypt` alongside it for an encrypted root. Contributed by
Ondřej Kraus.
- `bcachefs data-read` padded its output with zeros it never read. `--len` is
what to ask for, not what was read: the ioctl's byte count was discarded and
the buffer is allocated zeroed, so a read that stopped early was padded out
and reported as a full-length write. Reported by ChH, who asked for more than
his file's length to get "the whole file plus some" out of a damaged video and
got something that wouldn't open. For a tool whose job is saying what is
actually on disk, invented zeros are the worst failure available - they are
indistinguishable from recovered zeros.
- `bcachefs data-read --no-poison-check` returned EIO instead of the bytes it
had. `BCHFS_IOC_PREAD_RAW` carries a count and an errors bitmask, because a
recovery read wants both, but the DIO completion replaced the count with the
errno and discarded data that was already in the caller's buffer. Also ChH, on
a stripe with one csum-bad block and another on an offline device.
- An unrecoverable checksum error is no longer reported as an IO error.
- Erasure coding couldn't converge on a full filesystem (#880). Stripe
allocation only fell back to reusing an existing stripe after a full-stripe
allocation had already failed at `BCH_WATERMARK_stripe`, while copygc was
evacuating into new stripes - so free space fell, fragmentation rose, and
neither term of copygc's wait calculation could come back. Copygc now
publishes which devices it is trying to free space on, and stripe allocation
packs into an existing stripe rather than allocating out of space copygc
wants.
- `bcachefs migrate` ate the source filesystem's free space.
`reserve_new_fs_space()` started at the whole device size and halved on
ENOSPC - but that's the block device, not the free space, so the first
`fallocate()` couldn't succeed on any non-empty filesystem and the retry path
ran on every migrate. `fallocate()` has no rollback: xfs and ext4 both leave a
partial allocation attached to the file, xfs flagged `PREALLOC` so the
eofblocks scanner won't reclaim it either. Each halving added to the file
instead of replacing it, and the loop left it holding what had been the disk's
free space.
- `bcachefs migrate` rolls its reservation back to what it opened rather than to
empty, and `find_superblock_space()` had `bucket_size` in the wrong units.
- `gc_gens` and the unpoison ioctl updated extents and reflink without a disk
reservation. There's a warning on that path now. Scoping `gc_gens`' reservation
to the walk that uses it also unbreaks the clang build: the old placement
jumped a `__cleanup__` variable past its initializer, which clang rejects
outright and gcc accepts.
- Snapshot repair undeletes a condemned parent chain, instead of recording
damage that could leave the filesystem unmountable.
- Recovery goes read-write when a pass has been scheduled, and says which
function took the filesystem read-only.
- The reconcile thread is restarted if it exited on its own, says why it exited,
and an interrupted scan no longer kills it.
- End of file on stdin is no longer reported as an incorrect passphrase, and
`derive_passphrase()` says what actually failed.
- Journal scrub no longer registers journal overlay iterators, skips pointers to
devices that aren't present, and the backpointers sweep no longer fills the
key cache.
- `bcachefs fs usage` distinguishes a stripe fragmentation counter that was
never computed from one that is genuinely zero.
### Build
- Builds against bindgen 0.73, which broke both the userspace and the DKMS
builds outright on distros that had it - reported by freswa on Arch. 0.73
wraps padding and union storage in a `#[repr(align)]` newtype, which a
`#[repr(packed)]` parent rejects, and it changes the layout of the padding it
was emitted to preserve. Both traced back to blocklisted system headers:
bindgen can't see across a blocklist that a pruned type is `Copy`, so every
union holding a `__le64` had been quietly degrading to a fallback that 0.73
made fatal.
- `system_unbound_wq` is deprecated as of 6.17 and 7.2 warns on every enqueue;
we use `system_dfl_wq`, with a compat define for older kernels.
### On-disk format
No metadata version change. Two additions: key type 39
(`logged_op_inode_opt_propagate`) in the logged ops btree, and the compat bit
`inode_opts_propagated`.
## v1.39.4 - Sun Aug 30 2026
An early release: `Cargo.toml` wasn't bumped at the 1.39.3 tag, so 1.39.3 calls
itself 1.39.2 - and that version is the key the prebuilt module fetch uses, so
the 1.39.3 DKMS package installed the 1.39.2 module. New tools against an old
module mounts a multi device filesystem with `Multiple sources`.
Also builds against 7.3.
### Bugfixes
- The mount timeout generator is installed into the initramfs now, not just the
real root - a bcachefs root is mounted by the initramfs's own systemd, so it
still had ninety seconds.
- Damage to a content btree schedules that btree's checks. Only the alloc family
and snapshots had cases, so everything else got the shape of the tree back and
nothing rechecked the keys under it.
- `bch2_journal_flush_seq()` called slow filesystems stuck: a flushing commit
serializes a preflush to every member with the journal write, so one device's
latency is a floor on the total, not the total. 5x, not 2x.
- Fixed an `ec_stripe_new` leak on a failed stripe allocation.
- `alloc_key_bucket_nonempty_to_empty_not_open` said "bucket going empty" for a
bucket going nonempty, and now prints the transaction, old key and backtrace.
## v1.39.3 - Sat Aug 29 2026
The mount and boot release.
A multi device filesystem that comes up with a device missing, or that needs a
long recovery, shouldn't require the user to know anything: no dropping to a
shell, no kernel command line parameters, no reading the manual to find out
what `degraded` means.
### Features
#### degraded=ask
When members are missing, mount now waits for them - `missing_dev_timeout` is
the new option controlling how long - and only then asks, instead of failing on
a device that was two seconds from being probed.
The prompt says which filesystem it is about and which devices are missing, and
offers read-only alongside mounting degraded. Where a mount needs more force
than `degraded=yes` you are asked which level to allow rather than told no, and
a mount that fails is retried once at `degraded=very` rather than leaving you at
a reboot. If the missing device turns up while you are reading the question, the
question is withdrawn and the mount continues.
#### Devices that arrive late
A member that shows up after the filesystem has already mounted is now handed to
it, and a device add that was interrupted partway finishes itself when the
device comes back online.
#### Split brain
When two devices have diverged, mount says what diverged and asks which history
to continue with, instead of refusing with a message about degraded mounting
that did not describe the situation.
#### Watching a recovery
A long recovery now shows what it is doing, on the boot splash as well as the
console: which pass is running, how far along it is, and how long it has been
going. Journal replay reports progress too, and `bcachefs device evacuate` shows
the rate as well as how much is left.
#### A long recovery is no longer killed at ninety seconds
A `.mount` unit gets `DefaultTimeoutStartSec` and then SIGTERM. Ninety seconds
doesn't make a slow recovery slow, it makes it impossible: every boot does the
same ninety seconds of work and is killed at the same point, forever, and the
symptom looks like a broken filesystem rather than a timeout.
A mount helper cannot raise this from the inside - a mount unit is never given a
`NOTIFY_SOCKET`, so `sd_notify()` returns 0 and does nothing - so we now ship a
generator, which runs before units are loaded and leaves a drop-in.
#### Encryption
The passphrase can be answered over a socket, so an encrypted root can be
unlocked from somewhere other than the console. It is handed to the kernel
directly rather than through a keyring, and a wrong passphrase is now reported
as a wrong passphrase instead of being mistaken for success.
#### Superblock writes on filesystems with many devices
A new replicas entry costs a superblock write, and on a large multi device
filesystem that happens constantly: the journal wanders, every device set it
lands on is a new entry, and every one of those writes is a barrier against the
slowest disk in the fleet.
Those writes may now skip rotational devices that hold little metadata - that
is, when leaving one out can't affect the process of determining which drives we
need in order to mount safely. An all-SSD filesystem still writes to every
member.
Superblock writes are also timed now, and show up in time stats.
#### Additional errors marked autofix
Six more errors repair themselves instead of asking - which for two of them
meant a filesystem that wouldn't mount:
- `journal_entries_missing`: a gap after an unclean shutdown isn't recoverable,
and refusing left the filesystem unmountable with advice to run fsck that
couldn't help, since mount time fsck won't authorize a non-autofix error
either. GH #1203.
- `subvol_children_not_set`: an index derived from the subvolumes btree, set
from the same key it indexes.
- `sb_clean_missing`, `sb_clean_journal_seq_mismatch`: the clean superblock is
an optimization that lets recovery skip journal replay; both repairs discard
it and fall back to the journal, which is authoritative.
- `stripe_sector_count_wrong`, `stripe_parity_block_sector_count_wrong`: gc has
just recounted every stripe block, and the repair writes back what it found.
#### Other
- Filesystems with many members mount again: the device list is passed to
`fsconfig(2)` one device at a time, falling back to `mount(2)` when the list
is too long for it.
- `bcachefs fs usage` reports a device that is listed but offline as degraded,
rather than as present.
- `bcachefs subvolume list` no longer aborts or silently truncates a recursive
listing.
- `bcachefs fs usage` shows how much of a device's stripe data sits in empty,
reusable blocks, per device and filesystem wide. The `fragmented` counter
charges a whole bucket for an emptied stripe member, so it can't distinguish
stranded space from space that is free for reuse - the difference between
copygc having work to do and copygc chasing its tail. Reads as absent until
`check_allocations` has recomputed accounting.
### Bugfixes
- A `ZERO_RANGE` or hole punch could be silently dropped, leaving the old
contents in place, seen as generic/363. `ei_reserved_*` is a cache of what the extents btree said over a range, and it
is cleared by truncate, fallocate and remap but not by writes - and buffered
writeback and O_DIRECT both allocate without going through
`bch2_folio_set()`, so a range the cache still calls a hole can quietly
acquire an extent underneath it. Nothing re-reads a folio that has data but no
state, so the stale `SECTOR_unallocated` stands, `__bch2_writepage()` skips
the block, and partial-block zeroing done in the page cache never reaches
disk.
- Erasure coding could reconstruct the wrong data when a parity block was among
the erasures. The "can we recover at all?" check counted erasures across the
whole stripe, but the list handed to `raid_rec()` was built over the data
blocks only, so a lost P or Q never made it. Since `raid_rec()` dispatches on
the number of erasures, two erasures reported as one took the single-erasure
XOR path and reconstructed the lost block by XORing in the parity block
already known to be bad, failing its checksum afterwards. Stripe reuse also no
longer fails on blocks it is in the middle of discarding.
- A filesystem could go emergency read-only during tiering.
`__bch2_btree_node_update_key()` gets `trans->has_interior_updates` for free
when it updates a non-root node, because that goes through
`bch2_trans_update()` on the parent - and that flag is what makes a full leaf
restart the transaction instead of splitting and retrying the commit in place.
Updating the root goes out as journal entries instead, so nothing set it; on
`reconcile_scan` the retry then commits into a btree whose node the split has
already freed.
- Userspace ran one worker per workqueue, so a work item that blocks stopped
every other item on that queue - merely slow in most places, but a deadlock
for an executor whose tasks are work items. Queues now grow up to
`max_active` workers, which makes userspace journal replay a lot faster, most
of all on multi device filesystems, where the per-device IO had been
serializing behind a single worker.
- Reusing a stripe held two buffers of the same size - the new one and the old
one it carries blocks forward from - from `head_get` all the way to create.
The old buffer is only needed to get the carried blocks out of, which can
happen as soon as the read lands, so a reuse cost twice what it needed to
against `ec_stripe_buf_limit`. That halves what a reuse costs against the
limit, which makes the reported stripe buffer memory deadlock harder to hit -
but does not resolve it: the limit can still be exhausted. GH #1182.
- Every write was taking a compression workspace sized for the worst case any
caller could ask for: LZ4 below `LZ4HC_MIN_CLEVEL` needs 16,416 bytes and was
taking 262,192. Compression and decompression workspaces are now separate and
sized for what the caller is doing.
- Hardening for corrupt or truncated keys reaching `to_text()` and validation
before the filesystem is fully set up, so a damaged filesystem reports rather
than crashing.
## v1.39.2 - Mon Aug 17 2026
Bugfix release on top of v1.39.1. No on-disk format changes.
### Features
- Mount finally uses the kernel's new mount API properly, which means mount
errors are now actually useful: when a mount fails the filesystem says what
went wrong, reported through the fs_context log, instead of handing back a
bare errno for you to guess at. `remount,rw` on a filesystem in emergency
read-only now returns an error too, rather than appearing to succeed.
### Bugfixes
- Fix contention between the journal and btree write buffer caused by allocating
memory under shared locks.
- Several btree iterator path lifetime fixes where a stale path pointer could be
used after the paths array had been resized, with new poisoning to catch such
bugs in the future.
- `bch2_btree_node_update_key()` sets `has_interior_updates` when it updates a
btree root. Without it a leaf that filled up during the commit was split and
the commit retried in place rather than restarted, which could free the node
whose key was being rewritten. The consequence was reconcile backpointers
going out of sync — not data corruption — which takes the filesystem
emergency read-only with `btree_ptr_to_bad_reconcile_bp`. Seen on tiered
setups.
- Removing a device could hang indefinitely. The btree write buffer's
flushed-state cache was keyed on the journal's write position rather than on
this transaction's own commits, so the guard was false on any busy
filesystem: the cache never hit, the flush re-ran and restarted every time,
and the backstop that would have broken the loop could never arm. Seen as
`bch2_dev_data_drop_by_backpointers()` spinning on
`transaction_restart_write_buffer_flush` with no way out.
- Reconcile could spin without making progress. Committing the reconcile-opts
update lazily signalled success as a restart, and a write buffer btree scan
can't see the keys its own commit just buffered — so it re-read the same
position, found the same work and committed the same keys forever. One
filesystem was observed making 22076 byte-identical commits from a single
thread in three seconds, moving no data.
- Fixed a deadlock between mmap and the debugfs interfaces: they copied to
userspace while holding btree locks, and the fault path takes
`mmap_lock -> snapshots.create_lock`, while buffered writes take
`create_lock -> btree`.
- A completed `fsync()` could fail to flush a device, for nocow writes only,
losing a write that a subsequent crash would then drop — silently, since
nocow extents carry no checksum. The fetch-and-clear in
`bch2_inode_flush_nocow_writes_async()` was a plain struct copy followed by
`memset()`, with nothing serializing the bio completion's `set_bit()` against
it, so a bit that arrived between the two was erased without ever being acted
on. A later fsync then finds the journal sequence already durable and the
mask empty, and returns without flushing.
It takes more than one device to hit. The erased bit only costs anything if
it names a device that wasn't already in the copied set — with a single
device that set either already contains it, in which case the flush covers
the write regardless, or the write landed after the flush and was never part
of that fsync's guarantee. So it needs one device already marked and a write
completing to a different, unmarked one inside the window between the copy
and the memset.
- Readahead is more flexible about producing extent aligned reads, avoiding
short livelocks; partially read folios are now tracked in `bch_folio`.
- Discard workers no longer spin against each other.
- The journal's open bucket throttle is taken from a watermark rather than a
single bit, and `journal_error_check_stuck()` is fixed.
- Debug ioctls no longer hold btree locks across `copy_to_user()`.
- Fixed a lost update in nocow flush accounting (`ei_devs_need_flush`).
- Reconcile options are committed rather than lazily committed.
- `gc_reserve_percent` documentation corrected: it maxes at 20, not 21.
## v1.39.1 - Sun Aug 9 2026
Bugfix release on top of v1.39.0. No on-disk format changes.
### Features
- check_lrus() should now be faster, pinning the btree that we'll be doing
random access to
- The journal is re-replicated when a device comes back.
### Bugfixes
- bindgen was botching ioctl macro parsing for some users (clang version
dependent?), leading to tools failing with ioctl errors; the ioctls numbers
- Multiple Rust/DKMS fixes: the Rust availability check reads the version out of
the kernel's own `libcore.rmeta` instead of `CONFIG_RUSTC_VERSION`, which only
records whichever rustc was present when the kernel was configured. That
mismatch failed builds that would have linked fine. Ubuntu HWE header meta
packages are accepted. are now exposed as constants from C shims.
- Various fixes for 32bit machines
- `subvolume snapshot`: snapshots are writable by default, and `--rw` now says
so rather than implying otherwise.
- An oops in reconcile after an erasure coding allocation failure, reported by
KruslLee, and crashes on 32-bit.
- fsck: several more small subvolume/snapshots repair fixes
- Long SRCU holds across btree node reads no longer warn; on a loaded system
doing long btree scans this filled the log.
## v1.39.0 - Mon Aug 3 2026
Feature release on top of v1.38.8, with an on-disk format change:
bcachefs_metadata_version_per_dev_fragmentation_lru
Major changes:
- Per-device fragmentation LRUs
- Failure domains
- File level damage tracking
- bcachefs kvdb
- Snapshot hardening
### Features
#### Per-device bucket fragmentation LRUs
The fragmentation LRU, used by copygc, is now per device instead of filesystem
wide. This solves long standing contention issues between reconcile and copygc,
particularly with tiered setups.
#### Failure domains
Devices can be tagged with a failure domain — a shelf, a chassis, a rack,
whatever the thing is that fails together — and replicas are spread across
domains rather than merely across devices. This covers data allocation, journal
replicas, and erasure-coded stripe blocks, which now require distinct domains.
Set it with the new `failure_domain` per-device option; `bcachefs fs
failure-domains` shows the layout.
Note that failure domains are only a hard constraint for erasure coding; normal
replicated allocations will reuse a failure domain if necessary to meet replicas
requirements; erasure coding will shorten stripes to the number of failure
domains available.
#### Damage tracking
What was lost is now recorded persistently, in a new btree, instead of being
printed once during fsck and thereafter recoverable only from logs. fsck records
inode-scoped damage keyed by `bch_sb_error_id`, and data lost to device
force-removal and to read errors is recorded the same way.
`bcachefs damage` shows what's recorded; the list can also be walked from
userspace through the new readdir/damage ioctls, and is exposed in debugfs. fsck
summarizes damaged paths at the end of recovery, resolving them through surviving
snapshot versions and naming the parent directory for inodes whose own dirent is
gone.
#### bcachefs kvdb
A new REPL for reading and editing btree keys and the superblock directly — the
tool most of this release's repair work was built and debugged with. It has
readline, tab completion for commands and btree names, and ^C interrupts the
running command. Read-only norecovery open is the default, with `--rw` to edit,
`--nostart` for superblock-only access, and `--journal` for `list_journal`.
Reads and writes go down to individual fields: `get`/`peek` take trailing field
paths, and vartail fields, named bitmask fields and enum value names for state
fields all work. There's a session snapshot context, overridable per-command with
an explicit `:snapshot` in a pos. Underneath it is new runtime type information
for the C structs (`#[derive(TypeInfo)]`).
#### Snapshot hardening
Snapshot deletion is the most destructive thing the filesystem does, and what
licenses it is metadata. That used to be a flag bit: one flipped bit, a torn
deletion or a half-finished repair could make a live snapshot look deletable.
Three things now have to agree before anything is deleted. The state fields are
enums whose values are at least 14 bits apart rather than bitflags, so no single
bit flip can turn one valid state into another. Deletion is no longer triggered
by the snapshot node alone: the snapshots and subvolumes btrees are independent
records of the same fact and both have to agree. And per-snapshot key counts let
deletion verify it actually moved everything, refusing and scheduling repair if
not. Deletion also no longer destroys information, and damage found at runtime
defers to repair instead of BUG_ON.
There's a lot of new repair code for damaged snapshot trees that would previously
have been refused, and it's tested by injection: `bcachefs kvdb` writes specific
corruptions into the btree, and the new `snapshot-inject` suite — 68 cases —
asserts that fsck detects the error, repairs it, converges, and the data
survives.
Credit to ZorbaTHut (Ben Rog-Wilhelm), who reported this and worked with us
extensively, providing metadata dumps and tests; several people jumped in on
this one.
#### Performance
ACL and per-inode-option lookups are skipped entirely when the inode has none,
via the new `has_access_acl`, `has_default_acl` and `has_inode_opts` flags.
Bucket allocation can be targeted. Erasure coding allocates stripe blocks near
the stripe's centroid and reallocates outliers.
#### Portability
PREEMPT_RT: new `mutex_noio` and `percpu_rwsem_noio`, with `sb_lock`,
`mark_lock`, the btree cache lock and the journal buf lock converted; `GFP_NOFS`
replaced with `GFP_NOIO`; data writes set `PF_MEMALLOC_NOIO`; `time_stats` uses
`local_lock`. 32-bit builds get `__aeabi_uldivmod`/`__aeabi_ldivmod` stubs for
ARM modules, 64-bit divisions via `div64_u64`, and a `mul_u64_u64_div_u64` fix
(#795). Also builds on `CONFIG_SCHED_ALT` (BMQ/PDS) kernels, with `WQ_PERCPU`
compat for kernels older than 6.17 and slab realloc compat for older than 6.18.
#### Tools
Offline `set-fs-option` and `set-state` actually write the superblock now.
`bcachefs list` works on mounted filesystems, `dump --single-replica` produces
de-replicated metadata dumps, and `kill_btree_node --error` can inject a csum
error type.
### Behaviour changes
**Reverted from v1.38.7:** multi-device filesystems no longer show the filesystem
UUID as the mount source.
A subvolume can now be deleted by rename-overwrite of its root, and `bcachefs
subvolume snapshot` takes `--rw`. Devices with durability=0 are excluded from
normal allocation logic, which changes placement on cache and tiering setups.
Commit-time validation of snapshot and subvolume state invariants is now on: a
buggy writer is caught in the act with a backtrace instead of leaving the mess
for fsck. It can be turned off with `no_commit_validate`.
New `btree_cache_shrinker_seeks` option (runtime, default 2) controls how readily
the shrinker reclaims btree nodes relative to other caches; `ratelimit_errors` is
now runtime-settable too. The unclean-shutdown journal sequence skip was widened
from 64 to 4096, the passphrase prompt is usable on raw early-boot consoles, and
`format` rejects `--version` together with `--source`.
### New ioctls
`BCH_IOCTL_QUERY_BTREE_KEYS` queries btree keys directly, with
slots/prev/all_snapshots/nofilter_whiteouts flags; it's what backs `bcachefs
kvdb` and `bcachefs list` on a mounted filesystem. `BCHFS_IOC_GET_DAMAGE`,
`BCHFS_IOC_CLEAR_DAMAGE` and `BCHFS_IOC_READDIR_FLAGS` (with a recursive damaged
mode) expose the damage btree. Also `BCH_IOCTL_SNAPSHOT_TREE_v2`.
### Bug fixes
Two buffered read bugs could return wrong data. A read that took an internal
retry could resume with a stale `bi_iter`, and separately a stale
`BCH_READ_last_fragment` could persist across retries — in both cases the read
completed successfully with the wrong bytes, silently. Reported by jrt37, with
an exceptional analysis pinning both.
Extent merging could corrupt compressed data: extents compressed in different
blobs were merged as though they were compatible. Reported by KatalinSB, who hit
it as akonadi database corruption under zstd. Relatedly, checksum type changes on
compressed extents and MAC width changes on encrypted extents were both mishandled
— reported by Zorba, with ktest reproducers for each.
Inode numbers were truncated to 32 bits in the VFS layer, so filesystems that had
allocated past 2^32 could return the wrong inode to userspace; readdir dirent
translation had a matching bug on 32-bit.
fsck: a `-ENOMEM` in `check_dirents` and unbounded transaction memory in the
`check_dirents`, `check_xattr` and `insert_snapshot_whiteouts` repair loops could
each stop a repair partway. `bch2_reattach_inode()` is now resumable under
partial commits, so a large orphan chain doesn't lose progress when a commit
splits. Also a null deref in `reconstruct_inode()` on an extent-less inum, and
`bch2_check_key_has_inode()` on inodes with only error keys — reported by
sickness, after a power outage took out both his replicas.
Elsewhere: deleting compressed snapshot extents could NULL-deref on a missing
disk reservation (reported by pio2398); a cross-snapshot `str_hash` duplicate
could BUG_ON; emergency read-only could remove a device that still had journal on
it; and a 34-device array on an 8GB box could OOM partway through fsck from
undeduplicated async btree ops (reported by Zorba).
### Documentation
New Principles of Operation sections: safety mechanisms, snapshots and snapshot
deletion, failure domains, and how `ec_max_data_blocks` and failure domains bound
stripe width (that last after doot asked on IRC). `bcachefs kvdb` documentation
is shared between `--help` and the PoO.
## v1.38.8 - Fri Jul 3 2026
- Fix dpkg builds.
- Fix journal preflushes being throttled by writeback throttling
## v1.38.7 - Fri Jul 3 2026
Bugfix and kernel-support release on top of v1.38.6, adding Linux 7.2 support
and DKMS Rust builds on kernels without CONFIG_RUST. No on-disk format changes.
### Kernel support and packaging
- Builds against Linux 7.2.
- bcachefs.ko can now be built with its Rust components even on kernels
configured without CONFIG_RUST, by vendoring the kernel's Rust support tree.
DKMS can also fetch a prebuilt, signed module instead of building locally when
one is available, and module signing for Secure Boot is supported. Mount now
reports the actual Rust build status rather than CONFIG_RUST.
### Erasure coding
- Stripes now go through the key cache, with assorted cleanups to stripe
deletion and triggers; several EROs have been removed and can now be repaired
more gracefully.
- Durability accounting for erasure-coded data was reworked and an off-by-one
fixed: reconcile now recomputes durability per candidate when selecting
replicas to drop, and floors invalid-device padding at the stripe's
repairable durability.
### Features and tooling
- Mount: mount by filesystem label; the mount helper honors mount(8)'s -f
(fake), -s (sloppy) and no-mtab compatibility flags and reports modprobe
failures; multi-device filesystems show the filesystem UUID as the mount
source. FUSE mount parses -o options and no longer writes daemon logs to /tmp.
- Commands/CLI: new `get-file-option`; `set-file-option` can delete individual
choice-typed options; the CLI accepts negative values and mask values for
bitfield options; typed usage shows full option paths; `unlock --check`
reports encryption and lock state.
- New `move_writes_fua` option. The previous release switched writes from
internal moves to REQ_FUA to avoid impacting fsync() latency, especially on
tiered setups where foreground writes that need to be synced would be on SSDs
and background moves would be to spinning rust, but this turned out to be a
drastic performance regression; using FUA for internal moves is now off by
default but available for further testing.
- Online device shrink is delegated to the kernel, so a mounted filesystem can
be shrunk with `bcachefs device resize`.
- format warns when replicas would share a disk, and wipes former-partition
filesystem signatures when formatting a partitioned whole disk (previously it
only warned).
- subvolumes may now be listed recursively
### Bug fixes
- **fsck** could loop, repeatedly "repairing" the same need_discard/freespace
entry without converging: the write-buffer flush cache wasn't invalidated when
a repair committed, so the re-check read stale data and re-flagged a key it had
just fixed. fsck now tracks the journal commit sequence and re-flushes once a
repair has landed.
- **fsck** was also drastically slowed by unratelimited repair logging: a log
class meant to ratelimit repeated messages never did (the suppress flag was
accepted but discarded), and a second path had its ratelimit inverted. Both
are fixed.
- A stale or mismatched erasure-coding stripe pointer is now logged as a
repairable fsck error and repaired, instead of taking the filesystem
inconsistent.
- Snapshot repair hardening: keys are migrated out of deleted interior nodes,
and accounting is checked before destructive node transitions.
- Fixed a use-after-free in erasure-coding stripe buffer teardown; two journal
read bugs (an uninitialized full-read flag and an undersized journal-rewind
re-read buffer); HAS_TOPOLOGY_ERRORS is now cleared when check_topology passes
clean; and alloc-info checks are cancellable.
- Encryption: fixed superblock encryption on big-endian systems; key material is
zeroed on drop; the systemd-ask-password key name is shared with cryptsetup.
- Security and permissions: per-object accounting ioctls now require
CAP_SYS_ADMIN; security xattrs are initialized on inode creation.
- Devices: udev is refreshed after device add; multipath prefers mapper paths
and verifies the underlying rdev before substituting a mapper devnode.
- `bcachefs fs usage` tolerates offline devices; recovery logs journal-replay
progress; write-buffer and nocow lock waits are now SRCU-aware; and data reads
verify that gzip decompresses to the full extent size.
### Documentation
- Extensive manpage and documentation improvements, covering degraded and
split-brain mount recovery, superblock recovery, encryption key handling,
subvolume queries and quotas, device options, filesystem limits, and more.
## v1.38.6 - Wed Jun 17 2026
Feature and performance release on top of v1.38.5. No on-disk format changes.
### Performance
Performance work spanned much of the codebase, quite a few workloads and
benchmarks were profiled. Some highlights:
- Many performance improvements in the journalling code, primarily targeting
lock contention. Journal flushes are now fully lockless, significantly
improving performance on multithreaded O_SYNC/fsync workloads.
Journal pin lists now have per-pin-list locks instead of sharing the main
journal lock, and the journal pin fifo can now be resized at runtime; this
avoids unnecessary throttling on O_SYNC/fsync heavy workloads.
Journal read now has to read significantly less of the journal by using a
binary search to find the most recent entry on each device, which we're also
taking advantage of by increasing the default journal size.
- The core btree iterator and transaction commit code saw significant profiling
and optimization, greatly reducing icache usage in particular.
- Btree sharding was greatly improved; we now shard new inode allocations based
on pid, not the current cpu, enforce that btree nodes do not cross shard
boundaries, and on lock contention we try to migrate threads to the CPU for
their data's shard. This drastically reduces lock contention; high client
count dbench particularly benefited.
- Multithreaded btree write-buffer flushing saw more improvements, reducing
stalls due to lock inversion, and runtime introspection was greatly improved.
### Features
- We now support up to 255 devices in a filesystem
- Ubuntu 26.04 now has packages available at apt.bcachefs.org
### Bugfixes
- Some OOM issues were fixed; throttling when the btree node cache is too dirty
was significantly improved
- Reconcile won't get stuck in hysterises when there's high priority work to do
- Reconcile no longer spins when btree nodes need to be moved, but can't be
written with the full requested durability
- A few EC corner cases were fixed, including in device removal
- Device add is now fully transactional; crashing partway through won't leave
accounting/allocation info for the new device in an inconsistent state
- Some rare deadlocks in the device error handling paths were fixed
- bcachefs wait-devices now uses the same superblock filtering logic as mount,
so stale superblocks from removed devices are ignored consistently.
## v1.38.5 - Wed Jun 10 2026
Bugfix release on top of v1.38.4. No on-disk format changes.
### Bug fixes
Mounting after an unclean shutdown could OOM during journal replay on
filesystems whose journal is large relative to system memory (i.e. many
devices): journal replay's sorted-order fastpath holds every journal pin
until replay finishes, which prevents journal reclaim from writing back
and freeing dirty btree nodes — so on a large journal the btree node
cache could eat all of memory before the journal-space fallback ever
triggered. Journal replay now watches the btree node allocator's
memory-pressure self reclaim counter (also newly shown in the btree_cache
debug output) and switches to sequential replay, which releases journal
pins as it goes. Reported by ZorbaTHut.
The DKMS build was broken on kernels older than 6.18
(`kvmalloc_node_align` is a 6.18+ API; one call site was missing a
version guard). Reported by marcin.
`bch2_update_unwritten_extent()` was dropping the write op's flags when
allocating for an unwritten extent conversion.
Fixed a NULL pointer dereference in the `bfloat_failed` debugfs file.
### Userspace
`bcachefs fsck -o recovery_passes=<passes>` now honors the explicit pass
selection: previously the fsck option was still set, which ORed in the
full fsck pass set on top of the user's request.
### Other
- Debug builds now announce themselves in the log at startup.
## v1.38.4 - Tue Jun 9 2026
Bugfix release on top of v1.38.3. No on-disk format changes.
### Userspace
`bcachefs fs top` gained live tracepoint drill-down: every counter on the
counters page now has an interactive drill-down (Enter) into a live tail
of the corresponding tracepoint, scoped to the current mount. Scrollback
with arrows/PgUp/PgDn, End to resume following the tail.
### Bug fixes
`bch2_dev_add()` is now transactionally correct — the device add path was
missing a superblock write, and the bucket-usage accounting was not
idempotent across recovery, so a half-finished device add on a crashed
filesystem would double-count free space, and the device label would not
be persisted.
A number of btree-update error-path bugs were fixed — under heavy
split/rewrite load (copygc, tiering, rebalance) a failed interior update
could leak btree node locks and open-bucket refs, eventually wedging the
filesystem at shutdown.
Two erasure coding bugs were fixed — a pointer collision when migrating
stripe blocks between devices, and a bug where evacuated buckets ignored
EC (erasure coding) data, so some blocks were left behind on device
removal. Also, `stripe_update_extent` had been dropping excess replicas
without calling `set_needs_reconcile`, so the filesystem wasn't
re-replicating degraded stripes.
An OOM under memory pressure was fixed — the btree-key-cache shrinker was
giving the VM a zero-cost hint (`seeks=0`), causing pathological cache
refill, and the btree buffer cache wasn't self-reclaiming when the system
was tight. Reported by TiCPU.
Backpointers repair in fsck can now repair duplicate extents pointing to the
same data.
### Other
- `bch2_subvol_is_ro_trans()` now returns true for subvolumes that are
being deleted — create/rename/setattr could previously modify a subvol
mid-deletion.
- Promotes to cache devices no longer risk landing on a zero-durability
device.
- `shard_inode_numbers_bits` is now capped by filesystem size — on small
filesystems pre-split metadata was blowing the filesystem create budget.
- Journal discard workqueue no longer use-after-frees on going read-only.
- DKMS build fixes.
## v1.38.3 - Sun May 10 2026
Maintenance release on top of v1.38.2. No on-disk format changes.
### Erasure coding: in-place stripe widening
Stripes can now widen — adding data blocks when more devices become
available — without a full re-encode. New `bch_stripe.can_widen` field
tracks eligibility; reconcile-scan refreshes it on existing stripes,
and a fresh fsck check ensures it stays consistent. Previously the
only way to grow stripe width was to write new data into a wider
stripe and let the old one age out via copygc.
### Performance
- 3:2 btree node merging: btree node occupancy roughly doubles, and a cache for
utilization of evicted btree nodes - btree node merge attempts no longer
thrash the btree node cache.
- `__bch2_bkey_unpack_key` is now significantly faster, using precomputed format
constants.
- Per-btree btree write buffer flushing is now properly multithreaded, and out
of the journal reclaim thread.
- With reconcile now generating much heavier metadata workloads, we now have
ratelimiting for btree node cache utilization and IO pressure, addressing OOM
issues on some fileserver workloads. This will in the future be rolled into
the generalized backpressure subsystem; we'll be watching to see how this
affects performance.
### Userspace
`bcachefs fs top` gained live tracepoint drill-down: every counter on the
counters page now has an interactive drill-down (Enter) into a live tail
of the corresponding tracepoint, scoped to the current mount. Scrollback
with arrows/PgUp/PgDn, End to resume following the tail.
### Bug fixes
Many - the full test suite in the CI is now down to 15-20 failures per run, out
of 13k tests.
## v1.38.2 - Sat May 2 2026
### Build fix
`bdev_rot()` was introduced in Linux 7.0, not 7.1 as the v1.38.1 shim
assumed — so the DKMS module failed to build on 7.0.x with a
"redefinition of 'bdev_rot'" error. Shim is now correctly version-gated
to `< 7.0`.
### Performance: accounting read
Fix an O(N×R) memmove pattern in `accounting_read_mem_fixups`. The pass
that drops zeroed/invalid entries was iterating reverse and calling
`darray_remove_item` per drop, which memmoves the tail back on each
removal. On large multi-device filesystems the replicas table grows
combinatorially with device count, and many entries come back zero on
read, so the cost was dominating mount time. Replaced with an in-place
forward filter — O(N) total. Reported by feedc0de (63-drive array).
## v1.38.1 - Sat May 2 2026
Maintenance release on top of v1.38.0. No on-disk format changes.
### Linux 7.1 support
The DKMS module now builds against Linux 7.1. Several upstream kernel
changes broke the previous build:
- `xor_blocks()` → `xor_gen()` (chunking is now handled internally)
- `bool_names` (fs_parser) is now static; carry our own table
- `bdev_nonrot()` → `bdev_rot()`
- `<linux/pagevec.h>` → `<linux/folio_batch.h>`
Older kernels remain supported via version-gated shims.
### Performance
The locking subsystem and btree cache both got significant work.
- SIX locks/cycle detector: The deadlock cycle detector is now significantly
faster, fully lockless with no atomic operations or barriers, and we now
prioritize the oldest transaction on lock wakeups and deadlock avoidance
aborts, significantly improving performance on multithreaded workloads with
lock contention.
- Btree write buffer flushing is now multithreaded
- The btree node cache saw significant cleanups and refactoring, and now has
separate clean and dirty lists, again for improved performance under load.
- Btree node merging: lookup-side btree node merge attempts are now much less
aggressive; this was causing significant btree node cache thrashing on some
large filesystems. More performance improvements are on the way.
- When waiting on a device to have free buckets available, spurious wakeups
should be significantly reduced.
### New mount option: `ec_max_data_blocks`
Caps the data-block count of new EC stripes. Lets you keep stripe
width below the device count when you don't want a full-width
stripe — useful when the device count is high but you'd rather
limit the read-amplification cost on stripe reconstruct.
### New: `bcachefs wait-devices`
New command that waits for all devices of a multi-device filesystem
to be present before exiting. Intended as a `WantedBy=` of a `.mount`
unit so systemd doesn't try to mount before all members are visible.
Ships with a `bcachefs-wait-devices@.service` template unit in the
Debian package.
### Userspace
`bcachefs fs top` gained live tracepoint drill-down: every counter on the
counters page now has an interactive drill-down (Enter) into a live tail
of the corresponding tracepoint, scoped to the current mount. Scrollback
with arrows/PgUp/PgDn, End to resume following the tail.
### Bug fixes
Discard:
- **Per-device discard rewind-advance budget**. The journal-rewind
buffer used by the discard worker was sized fs-wide, which meant
one device with little need_discard activity could starve the
budget for another. Now per-device. Fixes the discard worker
iterating but finding nothing (`seen=0`) on multi-device
filesystems.
- Properly flush in-flight discards before finding more.
- `bch2_discard_one_bucket()` now respects `buckets_nouse`.
- Sysfs FS-level entry for `OPT_FS+OPT_DEVICE` opts (just `discard`
today) is dropped — it had been lying on read and silently
no-op'ing on write. The per-device sysfs entries and the
mount-time `-o discard=` flag are unchanged.
Recovery / fsck:
- Journal rewind now actually runs on clean filesystems (was a
no-op).
- Fix "Second fsck run was not clean" false positive.
- Torn-read race in `bch2_sb_update()` fixed (the
`bucket_gens_key_wrong` reconstruct_alloc flake).
Reconcile:
- Always flush the btree write buffer when starting a phase.
- Stop reconcile before disabling `c->writes` on going-RO.
Locking / transactions:
- six_lock: fix wait_fifo leak on grow-race + `-ENOMEM` path.
- Disable migration when in a transaction (per-CPU state stays
stable across the trans).
- migrate_disable scope narrowed to btree-locked sections (also
unblocks suspend on bcachefs).
EC:
- `should_cancel_stripe()` now checks reused-block ptrs.
- Bounded drain of in-flight stripe commits on going-RO.
Btree:
- Cache cannibalize lock leak in `node_get_noiter`.
- Memory-alloc error path leak in `bch2_btree_node_mem_alloc()`.
- `bch2_btree_path_fix_key_modified` re-sorts the iterator after a
key modification.
- `fpunch` no longer deletes multiple extents at a time.
- Drop stale `BUG_ON` in `bch2_read_retry_nodecode()`.
Other:
- Direct IO read error path fix.
- Shutdown-specific journal quiesce.
- `str_hash` repair: missing `traverse()` in `dup_entries` (and a
separate one in `repair_key`).
### New: per-device `freelist_wait` counters
Per-device counters for allocator wait events, plus explicit helpers
to manage them. Gives much better visibility into which device is
the contention point during allocator stalls.
### Removed: `btree_cache_size_max` mount option
Reverted. This was a workaround capping btree cache size to force
cannibalization under memory pressure; the btree cache work in this
release addresses the underlying issue properly. Anyone who set the
option can drop it.
### Tools
- `bcachefs top` and `bcachefs timestats` got paged, tabbed,
scrollable displays. With many devices the per-device tables had
been pushing other stats off-screen; pages now grow independently.
`timestats` also adds an `e` toggle between lifetime and
recent-EWMA views, freeing columns to show frequency mean/stddev.
`top` drops the `d` devices toggle (subsumed by the devices page).
Keys: Tab/Shift-Tab to switch pages, Up/Down/PageUp/PageDown/Home/End
to scroll.
- `bcachefs migrate` no longer enables reconcile/copygc during
migration — data was being moved (and re-checksummed) before the
new superblock had been committed.
- `list_journal -o` now accepts mount options; non-negotiable
journal-reading flags are layered over the user's options.
### DKMS / packaging
- DKMS module now builds against Linux 7.x and later (#557).
- DKMS keeps debug symbols in the installed module — useful for
meaningful backtraces in perf/trace output when users hit bugs.
- musl build fix: use `libc::Ioctl` instead of `libc::c_ulong` for
ioctl request constants (#561).
- APT repository: published-repo instructions corrected, key files
now armored `.asc`, CI workflows switched to a binary keyring.
- Nix flake: instructions for pulling a snapshot version, a
`nixosModules` configuration template, rust overlay composed at
the flake level, and module-package resolution through overlays
(#533).
### Build
- MSRV bumped to Rust 1.85.
- Userspace `ida_alloc_range`/`ida_free` implementation — `fast_list.c`
needed the modern API and the legacy shim was never implemented, so
the userspace build was broken as soon as it started compiling that
file. Implemented as a d-ary bitmap tree rather than vendoring
`lib/idr.c` + `lib/xarray.c`.
- Various Rust cleanups: `PathBuf` for paths in `device_scan.rs`,
`parse_uuid_equals` extraction, `read_super_silent` returns
`BchError`.
## v1.38.0 - Sun Apr 19 2026
bcachefs_metadata_version_need_discard_by_journal_seq
The `need_discard` btree (tracking buckets pending discard) is now
indexed by journal sequence number instead of device/bucket. This
reshapes how the allocator cooperates with the discard worker.
- Fixes allocator-stuck-on-mount regressions (#1105, #1108).
Previously, mounting a filesystem whose metadata devices had very
few free buckets could stall during journal replay — the allocator
and discard worker couldn't make progress past each other. The new
layout breaks that deadlock.
- Much faster sustained discard throughput. The discard worker
now iterates the need_discard btree in seq order directly, rather
than scanning the full set each pass. Noticeable on write-heavy
workloads, particularly on larger filesystems.
Upgrade is automatic on mount. Downgrade to a pre-1.38 version
requires offline downgrade tooling (existing format supports this).
### Journal pipelining
Previously we were limited to 16 in flight journal writes at a time, but for
large arrays this had become a severe bottleneck. We now have a separate
fifo for in flight journal writes; we currently allocate 256 entries, and if
that limit is ever hit it's now trivial to make growable at runtime.
### Faster snapshot_read at mount time
Users with large numbers of snapshots should notice dramatically faster mount
times; an accidental O(n^2) from incorrectly growing the in-memory snapshot
table has been fixed.
### Userspace
`bcachefs fs top` gained live tracepoint drill-down: every counter on the
counters page now has an interactive drill-down (Enter) into a live tail
of the corresponding tracepoint, scoped to the current mount. Scrollback
with arrows/PgUp/PgDn, End to resume following the tail.
### Bug fixes
- `bcachefs format` no longer misdetects SSDs as rotational when given a
partition (#554). If you created a filesystem on a partition (e.g.
`/dev/nvme0n1p3`) with 1.37.5, the rotational flag may have been set to 1
incorrectly; re-check with `show-super` and adjust if needed. New filesystems
are correct.
- Fix reconcile spinning forever on encrypted filesystems with nocow enabled.
These options are not compatible — encryption
falls back to COW automatically now. Documented in the man page.
- Fix `bcachefs migrate` failing on some devices due to O_DIRECT alignment
issues.
- The stripe repair path now correctly handles full stripes with a block on a
device that has been force removed and need to be shrunk - instead of spinning
when it picked the block on the force-removed device to evacuate.
### Tools
- `bcachefs dump sanitize` output is now correct (was inverted for
certain key formats).
- `list_journal -k` now correctly handles multiple ranges with
per-range signs.
- GPG signing key for `apt.bcachefs.org` is now published directly
at that URL. (Note: Debian third-party-repo policy issue flagged
in #555 is not yet resolved; will address in a follow-up.)
- Documentation for nocow+encryption interaction.
### Documentation
The principles of operations continues to grow; it now has more extensive
documentation on btree internals and architecture, from folding in and updating
documentation that was previously on the wiki.
## v1.37.5 - Mon Apr 7 2026
New features:
- Offline device add: `bcachefs device add` now works without the
filesystem mounted, discovering member devices automatically
- Show device serial numbers in `show-super` output
Bug fixes:
- Fix fd leak in format()
- Fix sticky device options not carrying across subsequent devices
during format
- Fix super_io write path (two fixes from intelfx)
- DKMS: add linux-headers virtual package fallback (#540)
Rust migration:
- Replace C `struct dev_opts` with Rust `DevOpts` type
- Safe typed field API for superblock access
- Safe wrappers for opts, dev_opts, opt_set_by_id, bch_opt_strs
- Move get_size, get_blocksize, fd_to_dev_model from C to Rust
- Add nonrot() Rust wrapper, replace C bdev_nonrot
- Safe error string access via errcode msg() method
- Remove unnecessary extern "C" from Rust-only functions
Kernel source updates:
- Fix handling of stripe_buf limits (#1096, #1098)
- Fix bad return code from stripe_reuse()
- Fix str_hash repair silently failing when insert finds duplicate
- Fix rename computing wrong hash with casefolding
- Reconcile: mark ec_alloc_failed extents as pending
- Preserve pre-recovery journal keys across journal_keys_sort
- Record device serial number in superblock
- Print write buffer state in journal stuck diagnostic
- Improved allocator error matching in foreground.c
- write_op_to_text(): include open_buckets
## v1.37.4 - Sun Mar 29 2026
New commands:
- `bcachefs data-read`: O_DIRECT read via BCHFS_IOC_PREAD_RAW with extended
error reporting (checksum, IO, decompression, and EC errors). Supports
`--no-poison-check` for reading poisoned extents.
- `bcachefs unpoison`: Clear poison flags on file extents.
Bug fixes:
- Fix shell completion generation panic
- Fix group subcommand dispatch off-by-one
Tools improvements:
- Migrated to clap derive for subcommand dispatch with typed Cli structs
- Enabled clap suggestions and color help, stripped debuginfo from release builds
Kernel source updates:
- Fix segfault in bch2_stripe_new_buckets_del()
- Fix reconcile checksum rewrite skipping cached pointers
- Fix use-after-free in ec_block_endio()
- Fix cached pointer handling in data update
- Fix init_new_stripe_from_old() copying parity blocks
- Fix torn write of path->l[0].b in btree_path_copy()
- Fix linking error on i586
- BCH_SB_MEMBER_INVALID pointers don't count as written or unwritten
- Don't add cached pointer devices to devs_have
- Don't reuse stripes when live data would overflow into parity
- Detect and repair non-zero parity blockcounts
- Plumb EC reconstruct messages to read path
- Add BCHFS_IOC_PREAD_RAW and BCHFS_IOC_UNPOISON ioctls
- Read path error reporting infrastructure
- Don't start reconcile unless we're really going rw
- Add timestats for btree node/key cache shrinkers
- Improve bch2_bio_to_text(), include bio on BLK_STS_INVAL read errors
- Improve error message when autofix blocked by errors policy
- Automatically advance rewind_seq when journal_rewind_discard_buffer_percent=0
Package CI:
- Publish to release suite for tagged commits
- Atomic publish via staging directory + rsync (fixes apt hash mismatch, #543)
## v1.37.3 - Fri Mar 20 2026
New option: opts.journal_rewind_discard_buffer_percent
This allows the size of the discard buffer for journal rewind to be adjusted -
tiering setups with significantly mismatched device sizes will want to turn this
down, or off.
- Ensure we don't accidentally create cached erasure coded pointers, which
aren't supported yet
- Fix buffer overflows when padding extents with `BCH_SB_MEBER_INVALID` pointers
- Fix a spurious -EAGAIN in the write path
- Fix a few bugs on 32bit x86
- Fix ppc64le build failures
## v1.37.2 - Mon Mar 16 2026
Bugfix release - fix an oops in mount from incorrect zeroing of
bch_btree_ptr_v2.mem_ptr, and a stripe repair assert.
## v1.37.1 - Sun Mar 15 2026
Bugfix release - fix compatibility issues with bch_sb_field_ext options.
## v1.37.0 - Sun Mar 15 2026
bcachefs_metadata_version_erasure_coding
Highlights:
- Erasure coding is no longer experimental; all the core functionality is
complete.
- Major update to the Principles of Operation - abbreviated PoO, or simply poo;
instead of "RTFM", you may now say "Have you checked your poo?".
It's now at 100 pages, organized into introductory, feature overview and
subsystem reference sections, and should be thoroughly comprehensive.
- New subcommands (subvolume list, list-snapshots, reflink-option-propagate)
- Journal rewind is now fully safe to use (the filesystem tracks how far back we
can safely rewind)
- Automatic recovery from devices with bad flush/fua support
- Faster recovery from unclean shutdowns
- Better perforance on multidevice filesystems: saner defaults for buffered
readahead, controllable by the new `dev_readahead` option.
- Linux 7.0 support
### Erasure coding
- Erasure coding is now hooked up to reconcile: degraded stripes are now
automatically repaired, like other degraded data, and can be reshaped as
needed. Tiering setups, and setups with mixed device sizes should work -
erasure coding will create the biggest stripes possible.
- Erasure coding is no longer hidden behind `CONFIG_BCACHEFS_ERASURE_CODING`,
but one significant item is still remaining - stripe allocation needs to
allocate blocks on different devices at similar LBAs, to avoid seeking when
resilvering an array. This should land in 1.38.
### Subcommands
- **`subvolume list`** (`bcachefs subvolume ls`): List subvolumes with
filtering and sorting. Uses userspace ioctl helpers for batch queries.
- **`subvolume list-snapshots`** (`bcachefs subvolume ls-snap`): List
snapshots as a tree with disk usage information.
- **`reflink-option-propagate`**: Propagates a file's IO options
(compression, checksum, replicas, targets) to its extents, including
reflinked extents. Respects a new per-pointer permission flag
(`MAY_UPDATE_OPTIONS`) to prevent unprivileged users from altering
shared data they don't own.
- **`fs top` TUI mode**: `fs top` and `reconcile wait` now use the
alternate screen for a proper terminal UI experience; fs top also shows
per-device stats.
- **Elastic tabstops**: Tabular output (fs usage, show-super, etc.)
now uses elastic tabstop alignment for cleaner, consistently aligned
columns.
### Journal rewind, automatic recovery from bad flush/fua:
- We now buffer discards, up to a small percentage of the device size, and track
in the journal how far back we can safely rewind (i.e. which old buckets have
not been discarded yet). Rewind is also now transactionally consistent - if we
crash mid rewind, we remember the previous in-progress rewind.
- The new `scrub_recent_journal_entries`, enabled by default after unclean
shutdowns, runs a targeted scrub during recovery on the data that was written
and committed just before crash or shutdown. On checksum error, indicating the
data wasn't actually written, an immediate repair will be queued up (on
replicated filesystems) - or if the data is not recoverable we'll automatically
rewind to the last good state. By default, we won't rewind more than 10
seconds, controlled by the `scrub_journal_max_rewind_secs` option.
### Userspace
`bcachefs fs top` gained live tracepoint drill-down: every counter on the
counters page now has an interactive drill-down (Enter) into a live tail
of the corresponding tracepoint, scoped to the current mount. Scrollback
with arrows/PgUp/PgDn, End to resume following the tail.
### Bug fixes
- Fix stdout buffering when piped (output now flushed properly)
- Fix utilization percentage in `fs usage` to use bucket counts
- Fix `copy_fs` write truncation
- Fix `readlink` c_char portability for arm64/ppc64el
- Fix `format` to create `sb_field_ext` before setting options
- Fix docgen command ordering
- Fix `escape_latex` mangling `--` flags as en-dashes
- Device evacuate: check filesystem version before starting
### Build system
- Package CI: cached build environments, cross-compilation fixes,
2-hour build timeout, architecture documentation
- Exclude `debian/` from C source discovery in Makefile
- Remove GitHub Actions build workflow (migrated to package-ci)
### Rust conversion progress
The userspace component of bcachefs has now been converted to Rust. Among other
things, this means we finally have bash autocompletions available, courtesy of
Clap.
Cleanup work is still ongoing - unsafe reduction, "Rusty" APIs to replace C
style ones. This is the test and staging ground for conversion of the kernel
side code to Rust, which will start happening as soon as Rust support is
sufficiently widespread in distro kernels.
This also enables formal verification, in Verus - work here has already started,
with proofs for eytzinger tree operations (search, inorder traversal, roundtrip
bijection), snapshot skiplist construction, snapshot tree invariants, and extent
overwrite conservation. 124+ verified properties.
## v1.36.1 - Fri Feb 6 2026
### New `bcachefs fs timestats` command
Interactive TUI for monitoring various filesystem internals, slowpaths and
device performance, with duration and frequency tracking for various events.
Helpful for diagnosing performance issues.
- `encoded_extent_max` default bumped to 256k; new filesystems now initialize
`BCH_SB_EXTENT_BP_SHIFT` to 16, so higher settings won't require rebuilding
backpointers
- `--rotational` flag now works correctly during format
- Copygc now waits until a device is less than 20% free before starting
- Improved `bcachefs reconcile status` output
- Large batch of erasure coding cleanup and hardening: better error reporting
for EC reconstruct reads, fix a race between EC and data moves, and various
other EC bugfixes
- Fix write buffer `move_keys_from_inc_to_flushing()` regression, which was
causing occasional oopses under load for some users
- Snapshot deletion is now much faster when deleting large numbers of snapshos;
we now use an eytzinger tree for the list of nodes being deleted
- Fix sporadic superblock checksum failures during device scan
And many smaller bugfixes.
## v1.36.0 - Sat Jan 31 2026
bcachefs_metadata_version_no_sb_user_data_replicas
This requires an incompatible upgrade to enable, and once enabled we'll no
longer store replicas entries in the superblock for user data, which are used
for deciding whether we an do a degraded mount without data loss - instead, we
defer that and use the accounting btree to check, in early recovery.
This is a performance/scalability fix: on filesystems with large numbers of
drives (a 50 device filesystem was the original bug report), the superblock
writes needed to add and delete replicas entries become a bottleneck.
Replicas entries for metadata (btree and journal) can still be an issue, and
another bug report indicated that these will have to be addressed soon - a
single slow (or dying) device in a large multidevice will cause all superblock
writes to slow to a degree that can cause major problems. Metadata replicas
entries will however require a different approach to solve, so expect that in a
future update.
- Some fairly involved fixes for the data update path: it turns out, the data
update path was dropping replicas to devices being evacuated (which are
considered to have durability of 0) before the extent was sufficiently
replicated on other devices. This caused data loss for a few users,
unfortunately, but the new code is much more rigorous when reconciling the
exsiting extent with newly written replicas and deciding which replicas to
keep and which can be dropped.
- Fix various codepaths that were (incorrectly) causing the filesystem to go
emergency read-only when finding a pointer to an invalid device, instead of
continuing so it could be repaired or flagging the filesystem as needing
repair. We now should only go emergency read-only on pointer to invalid device
when that would indicate a runtime bug, not filesystem corruption.
- Reconcile will now shut down correctly (when the filesystem is going read-only
or unmounting) when processing the reconcile_*_phys btrees.
- Multiple other smaller reconcile fixes; various users report that issues where
reconcile did not seem to be finding pending work seem to be resolved.
- Degraded btree nodes are no longer un-degraded synchronously; now that we have
reconcile this is no longer necessary, and forcing them to be un-degraded
synchronously was prone to causing deadlocks on open_bucket allocation.
- The 'allocator stuck' log message now provides improved information, and
internally has been re-plumbed to have access to the original 'struct
alloc_request', so if necessary for future debugging we can easily provide as
much information about how the allocation was attempted as required.
## v1.35.2 - Tue Jan 20 2026
- Linux v6.19 is now supported
- Reconcile now considers the amount of durability we have available among
online devices when dropping extra replicas (because the replicas setting was
changed), and won't let the online durability go below the replicas setting.
- Fix a race in the nocow write path when checking if we need to fall back to a
normal COW write
- Fix a livelock when walking btree roots in reconcile and elsewhere
- Journal discards are now done asynchronously instead of being done by the
journal reclaim thread, and we try to keep more of the journal discarded to
avoid journal writes having to block and do discards synchronously
- Fix several bugs with copygc <-> reconcile interaction, and copygc should no
longer spin when a device is completely full with no fragmented buckets for it
to evacuate.
- Fix propagating the incompressible bit in the data update path: sometimes this
would be lost, leading to spurious "extent with bad/missing reconcile options"
errors.
## v1.35.1 - Fri Jan 16 2026
- Self healing for the new stripe refcount field in `bch_alloc_v4`
This fixes issues upgrading to 1.35 with (still experimental) erasure coding
feature.
- Major allocator refactoring, simplifying the central control flow. Prep work
for failure domains.
- Erasure coding can now delete stripes from triggers; this gives better
behaviour when data being deleted with no other activity to cause stripes to
be deleted.
- Fix a deadlock in device add when allocating journal on the new device; this
fixes a regression from the watermark cleanup.
- Fedora builds are working again
## v1.35.0 - Mon Jan 12 2026
bcachefs_metadata_version_bucket_stripe_index
- The requirement that devices must have matched bucket sizes to be members of
the same stripes has been removed.
- Stripes may be reshaped (number of blocks increased or decreased), as needed;
this improves EC's handling of device failures.
- Significantly improved evacuate, rereplicate performance on rotating disks: we
now launch one thread per device being read from (i.e. every device that
shared data with the device going away); each device is read from in parallel
with reads across the whole device done in sorted order.
- `backpointer_scan_iter`, for improved performance for code doing backpointer
-> extent walks, including but not limited to reconcile; this is quite
significant on systems with metadata on rotating disk and relatively limited
memory.
- The bug with reconcile where btree roots wouldn't be processed has been fixed.
- A few bugs with reconcile's handling of cached data have been fixed.
- The reconcile tracepoints, especially `reconcile_set_pending`, now give
significantly more information.
- Reconcile now knows how to wait on copygc when a device it wants to write to
is full, rather than (incorrectly) marking the extent as pending.
- Fixed several memory reclaim recursion bugs; performance under memory pressure
should be improved.
- Various allocation watermark fixes; btree updates now only run with high
priority watermarks when necessary. This fixes some allocator deadlocks on
open bucket allocation.
- 'encoded_extent_max` settings of 1MB and greater now work properly;
previously, this could cause backpointer issues if compression was enabled.
Along with numerous other bugfixes.
## v1.34.0 - Sat Dec 27 2025
bcachefs_metadata_version_extended_key_type_error
- `KEY_TYPE_error` keys new include a field that indicates the reason and
codepath they were created
- We now run `check_snapshots` before deleting interior snapshot nodes, after
observing a bug where bad skiplist entries were created due to prior
corruption of the snapshot depth field.
- The compression code now always bounces the source buffer if it may have been
mapped to userspace; this should solve reports of corruption with zstd
- `str_hash` (dirents and xattrs) repair now handles keys in different snapshots
correctly
## v1.33.4 - Thu Dec 25 2025
- Fix a critical bug with interior snapshot node deletion:
Interior snapshot nodes can't be fully deleted at runtime while the filesystem
is in use, since snapshot tree fixups can require adjustments to arbitrarily
many nodes and can't be done atomically, so we defer them until the next mount
(all the heavy lifting of deleting/moving keys that refer to those snapshot
nodes is done at runtime).
But, incorrectly, we were doing interior snapshot node deletion before going
RW: before going RW, transaction commits use a different path that queues up
updates to the list of updates for journal replay - and this path doesn't run
in-memory triggers, but snapshots use an in-memory trigger for keeping the
in-memory snapshots table in sync with the snapshots btree - this broke
`snapshot_is_ancestor()`
Affected users would see filesystem corruption that disappeared on the next
remount.
This is fixed by now doing interior snapshots deletion just after going RW,
but before starting processes that require snapshots lookups.
- New mode for verifying the result of data compression, before writing
compressed data out to disk.
There's been sporadic reports of corruption when zstd is in use; to track this
down, there's a new `verify_compress` module parameter. When enabled, we
decompress data immediately after compressing and verify the result with
memcmp(). On mismatch, we mark the extent as incompressible and print an error
with the file, offset and length; this will let us find the exact data that
caused the error and do further testing.
- Reconcile no longer runs when the filesystem is mounted read only.
When a filesystem is mounted read only, we will still go read-write internally
if we need to fsck or do journal replay. There are two main background tasks
we start when going read-write for background data processing: copygc and
reconcile. Copygc is required to run when we're read-write for the allocator
to be guaranteed to make forward progress, but reconcile is not.
- We no longer include durability=0 devices when calculating filesystem
capacity.
## v1.33.3 - Mon Dec 22 2025
- More snapshot deletion fixes, old interior snapshot nodes should finally be
getting cleaned up correctly
- We now run `check_snapshots` on every mount; there have been some bugs which
result in snapshot tree corruption in the depth/skiplist fields, breaking
`snapshot_is_ancestor()`. We can't efficiently detect this kind of corruption
at runtime, but `check_snapshots` is no more expensive than `read_snapshots`;
if we still have bugs in snapshot deletion, this will render them harmless.
- Some obscure repair paths are now more robust - str_hash mismatch repair,
inode reconstruction.
- Btree node rewrites no longer run at `BCH_WATERMARK_btree` by default; this
should solve some deadlocks that started happening when reconcile started
moving around a lot more btree nodes.
- When we get a ZSTD decompression error, the specific error code from zstd will
now be reported in the error message.
## v1.33.2 - Wed Dec 17 2025
(Almost) bugfixes only:
- Fix multiple bugs involving deleting interior snapshot nodes
- Fix an assertion pop caused by leftover rebalance scan cookies, from
pre-1.33.0
- Fix mmap-involved page cache inconsistency/corruption, users generally noticed
this as files that seemed to be corrupted by the cp afterwards
- Fix a topology inconsistency caused by a transaction commit merging a node we
were updating a key for in the same transaction; we now have stricter topology
checks
- Online fsck now understands `-o recovery_passes`
- Copygc (and elsewhere) now correctly uses the 'fragemented' counter under
`dev_data_type` accounting; intricacies of compressed data accounting mean
that `buckets * bucket_size - sectors` does not work for this, and may
underflow.
- New recovery pass: `kill_i_generation_keys`. Modern filesystems do not use
`KEY_TYPE_i_generation` for implementing NFS inode generation numbers, and old
filesystems may have significant amounts of wasted space in the inodes btree
from these. Must be run manually, and can be run online.
- Subvolumes and snaapshot trees are now viewable in debugfs, along with the
per-snapshot accounting. These should be considered prototype interfaces, to
give users something to look at and comment on before the real interfaces are
designed.
- Snapshot accounting is no longer kept in-memory; this fixes slow
`accouting_read` on filesystems with huge numbers of snapshots.
## v1.33.1 - Thu Dec 11 2025
### Recovery passes will now be run in the background when possible
When a scheduled recovery pass and all scheduled passes that depend on it can be
run online, we'll now run it in the background instead of blocking mount.
This means that upgrades to 1.33 from previous versions will now happen in the
background.
### Bugfixes:
- We now avoid blocking on memory reclaim when allocating btree node buffers; it
was discovered that under memory pressure it can take > 10 seconds to satisfiy
a single allocation due to compaction. We'll now fall back to vmalloc much
quicker.
This should help with the SRCU lock hold time warnings that have still been
popping up.
There's a new btree node cache statistic to track the number of vmalloc
allocations; if we notice that this is now too high we may want to add a
background task to allocate physically contiguous buffers to replace the
vmalloc allocations (vmalloc memory is a bit slower than physically contiguous
memory).
- Fix a "pending incorrectly set" ERO
- Fix checking for device rebalance scan cookies, this will eliminate some
spurious "extent with incorrect/missing reconcile opts" errors.
- Snapshot deletion fixes; when multiple leaves were being deleted
simultaneously and interior nodes needed to be deleted too, the interior nodes
often wouldn't get cleaned up - and in rare situations keys could get moved to
the incorrect snapshot node, due to a DFS iteration bug.
## v1.33.0 - Thu Dec 4 2025
`bcachefs_metadata_version_reconcile` (formerly known as rebalance_v2)
### Reconcile
An incompatible upgrade is required to enable reconcile.
Reconcile now handles all IO path options; previously only the background target
and background compression options were handled.
Reconcile can now process metadata (moving it to the correct target,
rereplicating degraded metadata); previously rebalance was only able to handle
user data.
Reconcile now automatically reacts to option changes and device setting
changes, and immediately rereplicates degraded data or metadata
This obsoletes the commands `data rereplicate`, `data job
drop_extra_replicas`, and others; the new commands are `reconcile status` and
`reconcile wait`.
The recovery pass `check_reconcile_work` now checks that data matches the
specified IO path options, and flags an error if it does not (if it wasn't due
to an option change that hasn't yet been propagated).
Additional improvements over rebalance and implementation notes:
We now have a separate index for data that's scheduled to be processed by
reconcile but can't (e.g. because the specified target is full),
`BTREE_ID_reconcile_pending`; this solves long standing reports of rebalance
spinning when a filesystem has more data than fits on the specified background
target.
This also means you can create a single device filesystem with replicas=2, and
upon adding a new device data will automatically be replicated on the new
device, no additional user intervention required.
There's a separate index for "high priority" reconcile processing -
`BTREE_ID_reconcile_hipri`. This is used for degraded extents that need to be
rereplicated; they'll be processed ahead of other work.
Rotating disks get special handling. We now track whether a disk is rotational
(a hard drive, instead of an SSD); pending work on those disks is additionally
indexed in the `BTREE_ID_reconcile_work_phys` and
`BTREE_ID_reconcile_hipri_phys` btrees so they can be processed in physical
LBA order, not logical key order, avoiding unnecessary seeks.
We don't yet have the ability to change the rotational setting on an existing
device, once it's been set; if you discover you need this, please let us know so
it can be bumped up on the list (it'll be a medium sized project).
`BCH_MEMBER_STATE_failed` has been renamed to `BCH_MEMBER_STATE_evacuating`;
as the name implies, reconcile automatically moves data off of devices in the
evacuating state. In the future, when we have better tracking and monitoring
of drive health, we'll be able to automatically mark failing devices as
evacuating: when this lands, you'll be able to load up a server with disks and
walk away - come back a year later to swap out the ones that have been failed.
Reconcile was a massive project: the short and simple user interface is
deceptive, there was an enormous amount of work under the hood to make
everything work consistently and handle all the special cases we've learned
about over the past few years with rebalance.
There's still reconcile-related work to be done on disk space accounting when
devices are read-only or evacuating, and in the future we want to reserve space
up front on option change, so that we can alert the user if they might be doing
something they don't have disk space for.
### Other improvements and changes:
- Degraded data is now always properly reported as degraded (by `bcachefs fs
usage`); data is considered degraded any time the durability on good
(non-evacuating devices) is less than the specified replication level.
- Counters (shown by `bcachefs fs top` and tracepoints have gotten a giant
cleanup and rework: every counter has a corresponding tracepoint. This makes
it easy to drill down and investigate when a filesystem is doing something
unusual and unexpected.
Under the hood, the conversion of tracepoints to printbufs/pretty printers has
now been completed, with some much improved helpers. This makes it much easier
to add new counters and tracepoints or add additional info to existing
tracepoints, typically a 5-20 line patch. If there's something you're
investigating and you need more info, just ask.
We now make use of type information on counters to display data rates in
`bcachefs fs top` where applicable, and many counters have been converted to
data rates. This makes it much easier to correlate different counters (e.g.
`data_update`, `data_update_fail`) to check if the rates of slowpath events
should be a cause for concern.
- Logging/error message improvements
Logging has been a major area of focus, with a lot of under the hood
improvements to make it ergonomic to generate messages that clearly explain
what the system is doing an why: error messages should not include just the
error, but how it was handled (soft error or hard error) and all actions taken
to correct the error (e.g. scheduling self healing or recovery passes).
When we receive an IO error from the block layer we now report the specific
error code we received (e.g. `BLK_STS_IOERR`, `BLK_STS_INVAL`).
The various write paths (user data, btree, journal) now report one error
message for the entire operation that includes all the sub-errors for the
individual replicated writes and the status of the overall operation (soft
error (wrote degraded data) vs. hard error), like the read paths.
On failure to mount due to insufficient devices, we now report which device(s)
were missing; we remember the device name and model in the superblock from the
last time we saw it so that we can give helpful hints to the user about what's
missing.
When btree topology repair recovers via btree node scan, we now report which
node(s) it was able to recover via scan; this helps with determining if data
was actually lost or not.
We now ratelimit soft and hard errors separately, in the data/journal/btree
read and write paths, ensuring that if the system is being flooded with soft
errors the hard errors will still be reported.
All error ratelimiting now obeys the `no_ratelimit_errors` option.
All recovery passes should now have progress indicators.
- New options:
`mount_trusts_udev`: there have been reports of mounting by UUID failing due
to known bugs in libblkid. Previously this was available as an environment
variable, but it now may be specified as a mount option (where it should also
be much easier to find). When specified, we only use udev for getting the list
of the system's block devices; we do all the probing for filesystem members
ourself.
`writeback_timeout`: if set, this overrides the `vm.dirty_writeback*` sysctls
for the given filesystem, and may be set persistently. Useful for setting a
lower writeback timeout for removeable media.
- Other smaller user-visible improvements
The `mi_btree_bitmap` field in the member info section of the superblock now
has a recovery pass to clean it up and shrink it; it will be automatically
scheduled when we notice that there is significantly more space on a device
marked as containing metadata than we have metadata on that device.
The member-info btree bitmap is used by btree node scan, for disaster recovery
repair; shrinking the bitmap reduces the amount of the device that has to be
scanned if we have to recover from btree nodes that have become unreadable or
lost despite replication. You don't ever want to need it, but if you do need
it it's there.
- Promotes are now ratelimited; this resolves an issue with spinning up far too
many kworker threads for promotes that wouldn't happen due to the target being
busy.
- An issue was spotted on a user filesystem where btree node merging wasn't
happening properly on the `reconcile_work` btree, causing a very slow upgrade.
Btree node merging has now seen some improvements; btree lookups can now kick
off asynchronous btree node merges when they spot an empty btree node, and the
btree write buffer now does btree merging asynchronously, which should be a
noticeable improvement on system performance under heavy load for some users -
btree write buffer flushing is single threaded and can be a bottleneck.
There's also a new recovery pass, `merge_btree_nodes`, to check all btrees for
nodes that can be merged. It's not run automatically, but can be run if
desired by passing the `recovery_passes` option to an online fsck.
- And many other bug fixes.
### Notable under-the-hood codebase work:
A lot of codebase modernization has been happening over the past six months,
to prepare for Rust. With the latest features recently available in C and in
the kernel, we can now do incremental refactorings to bring code steadily more
in line with what the Rust version will be, so that the future conversion will
be mostly syntactic - and not a rewrite. The big enabler here was CLASS(),
which is the kernel's version of pseudo-RAII based on `__cleanup()`; this
allows for the removal of goto based error handling (Rust notably does not
have goto).
We're now down to ~600 gotos in the entire codebase, down from ~2500 when the
modernization started, with many files being complete.
Other work includes avoiding open coded vectors; bcachefs uses DARRAY(), which
is decently close to Rust/C++ vectors, and the try() macro for forwarding
errors, stolen from Rust. These cleanups have deleted thousands of lines from
the codebase over the past months.
|