In a message to the Linux Kernel Mailing Record yesterday, founding developer Linus Torvalds warned the world to not use the 5.12-rc1 kernel in his public git tree.
Hey peeps – a few of you might have already observed that in my public git tree, the “v5.12-rc1” tag has magically been renamed to “v5.12-rc1-dontuse”. It is nonetheless the identical object, it nonetheless says “v5.12-rc1” internally and it’s nonetheless is signed by me, however the user-visible title of the tag has modified.
Because it seems, when Linus Torvalds flags some code dontuse
, he actually means it—the issue with this 5.12 launch candidate broke swapfile dealing with in a really disagreeable means. Particularly, the up to date code would lose the right offset pointing to the start of the swapfile. Once more, in Torvalds’ personal phrases, “swapping nonetheless occurred, however it occurred to the unsuitable a part of the filesystem, with the apparent catastrophic finish outcomes.”
In case your creativeness is inadequate, which means when the kernel paged contents of reminiscence out to disk, the information would land on random components of the identical disk and partition the swapfile lived on… not as recordsdata, thoughts you, however as rubbish spewed on to uncooked sectors on the disk. This implies overwriting not solely knowledge in current recordsdata, but in addition somewhat massive chunks of metadata whose corruption would probably render the whole filesystem unmountable and unusable.
Torvalds goes on to level out that if you happen to aren’t utilizing swap in any respect, this drawback would not chunk you. And if you happen to’re utilizing swap partitions, somewhat than swap recordsdata, you would be equally unaffected. Sadly, he then reminds us that whereas he is aware of an absolute ton concerning the kernel, he is not essentially all that acquainted with all of the plumbing a traditional finish person is worried with:
And, so far as I do know, all the traditional distributions set issues up with swap partitions, not recordsdata, as a result of actually, swapfiles are usually slower and have numerous different complexity points.
Many distributions nonetheless default to swap partitions, somewhat than recordsdata. However Ubuntu—which is probably the one most generally deployed Linux distribution on the planet—has been installing swapfiles by default for greater than 4 years now. When you’re an Ubuntu person (or person of an Ubuntu-derived distro, comparable to Mint), you have most likely acquired a swapfile, and this bug would most likely trash your whole root filesystem.
Torvalds’ warning issues above and past what particular person customers would possibly do with a launch candidate kernel, nevertheless. It is much more essential that kernel builders not base their very own work round that launch and doubtlessly carry a very nasty bug ahead additional down the road.
I need to make it possible for no person begins new subject branches utilizing that 5.12-rc1 tag. I do know just a few builders are inclined to go “Okay, rc1 is out, I acquired all my growth work into this merge window, I’ll now fast-forward to rc1 and use that as a base for the following launch”. Do not do it this time. It could work completely properly for you as a result of you might have the widespread partition setup, however it might probably find yourself being a horrible base for anyone else that may find yourself bisecting into that space.
This additionally leads into considered one of my very own somewhat frequent warnings to fellow Linux customers: do not blindly leap forward into cowboy code that hasn’t but been sufficiently examined. Linux kernel launch candidates are often very, very strong, and it is tempting to dive into new options as early as attainable—however doing so can have very, very ugly penalties. And lots of of these penalties may have been prevented by ready for the code to enter manufacturing standing within the first place.