This is such a bad bad API compat breakage:
It's used all over the place in userspace. In systemd we use it:
1. to detect if a block device has partition scanning off or on
2. In our udev test suite, to validate devices are in order
3. udev rules use it for some feature checks (in older versions of systemd).
And it's even a frickin documented userspace API:
https://www.kernel.org/doc/html/v5.5/block/capability.html
So much about that nonsensical "we don't break userspace" kernel mantra.
@pid_eins impossible: the kernel never, ever breaks userspace compatibility. You must have been holding the sysfs wrong.
Anyone knows where the kernel's github/gitlab project is? Would love to file an issue or placeholder revert PR, but somehow I cannot find it! Anyone?
(Yes, this is a joke, I am fully aware of the concept of mailing lists – as a historical concept from the 2005 era... Yes, I am too lazy to figuring out how to report this properly. Hence social media it is.)
@pid_eins At least there is a place where issues won't get solved, but we can complain. In our office it's usually at the coffee machine.
Have you tried complaining on Reddit?
@ljs Look at the docs link I provided. It documents literally that the documentation for the bits is to be found in include/linux/genhd.h.
Sorry, but the ship has sailed. Adding such a comment to the documentation and expecting this not to be public API doesn't work.
Also, iirc the way I understood Linus the "we don't break userspace" actually is supposed to mean "we don't break userspace". Here it ceratinly breaks things all over the place.
@pid_eins There is a bugzilla https://bugzilla.kernel.org/
@zygoon Which noone looks at supposedly, and which is scheduled to be turned off soon, because mailing lists are apparently much better.
There you go:
BLOCK LAYER
M: Jens Axboe <axboe@kernel.dk>
L: linux-block@vger.kernel.org
S: Maintained
F: block/
@cJ I tried to click on this, but it didn't open a bug report form. What am I doing wrong?
(Dude, I know, I am just making fun of kernel development mechanisms, it's such a turn-off.)
Let me mention that I have sent an email to linux-block ML btw. I am not sure it went through though, can't find it on any mailing list archives.
It's the reliability and synchronous feedback I particular love about submitting bug reports, patches, and reviews via email.
@pid_eins Don't forget trying to deduce if you need to subscribe or not, or if they use moderation.
I once got a lecture from an angry maintainer (non-Linux) for "not appreciating timezones" after resending, 'cause it turned out they had undocumented moderation??
@ljs Well, how are userspace folks supposed to navigate kernel apis then? I mean, a good chunk of kernel apis are not documented at all, another chunk is pretty badly documented, and the stuff that actually *is* somehwat documented is something one should not have trusted, as you say?
I mean, the stuff is not just documented, it's also part of sysfs, i.e. one of the primary concepts for exposing kernel APIs to userspace which even has a rough concept of introspection and evrything
@ljs this is not a frickin ioctl of some niche subsys. It's very very core stuff exposed via sysfs, and documented (yes, badly documented, but still documented), with no other known way to get this very basic info.
Come on!
@ljs Also, the header definitely *did* exist when we started checking for the capability field.
You may not know know that I know you know.
But as you say, you're making fun of it.
You know that the kernel has a history of striving to have a distributed and "down to the essentials" development workflow, and sending and receiving plain-text e-mails can be done securely and by anyone.
The way you're making fun, it looks like you're simply diminishing other people's core values.
Maybe you can be the one to find something better than mailing lists (which are older than 2005....)?
@cJ @pid_eins I cut my software engineering teeth in the era of sending patches to mailing lists. There are many good reasons I don't do that any more.
There are just so many better solutions. In my previous role we used Gerrit, currently it's GitHub. Gerrit was superior, imho, and is self-hosted. Both are so vastly superior to mailing lists they're not in the same class. It's like the difference between git and CVS.
I've been an early systemd user and have included it most of my embedded Linux works too.
Still, I don't think there's a point in qualifying systemd as "the most sensible" unless you mean "in most cases" or for a particular purpose, otherwise the only answer is "it depends".
In the same way that I'm a "low-digits" github and gitlab user.
I am, like you, annoyed when people want to force their thing onto others while ignoring their valid concerns.
@ljs btw, the flag we used actually *was* fully documented even:
https://www.kernel.org/doc/html/v5.15/block/capability.html
Quoting:
"This file documents the sysfs file block/<disk>/capability."
…
"GENHD_FL_NO_PART_SCAN (0x0200): partition scanning is disabled. Used for loop devices in their default settings and some MMC devices."
That's such a bad API break
Small update: it's worse than originally thought:
1. Kernel broke API not once, but twice already on this.
2. The sysfs API was actually fully documented, but that didn't matter. Full docs are here:
@vbabka well, i a actually somewhat OK with braking APIs if need be. I am just a bit annoyed of carrying this claim "we don't break userspace" around all the time and not actually being really any good at it at all, and when it comes to actually breaking things, we are usually brushed off, called "whiney", and told that we "did it wrong" in the first place, and theat kernel's own docs where just "unfortunate", and it's not a bug, because the docs should not have been written like that anyway.
@vbabka I mean, systemd has APIs too, it's hard to keep them stable, we try, and every now and then we fuck up. But we never made it our frickin' mantra, and claimed we actually were really good at it. We do have invested a bit in trying to be OK at it though, i.e. have test suites, integration tests and shit, that validate the APIs automatically. It's not perfect, but it exists.
So, if the kernel would actually try to live up to its claim that they don't break userspace
@vbabka … then maybe have a testsuite for this, that actually checks this, and make maintainers care, to google for their interfaces before dropping them to see if they are used.
But as it appears right now, there's a massive difference between what the kernel community claims and what it actually does about it.
The "unbind" uevent thing was by far worse btw, showed total ignorance from kernel folks about any userspace API issues.
So this isn't really an isolated event, it's happens regularly
@ljs @pid_eins @vbabka the search function on Github has improved massively in the past year or so, and it's now really powerful. Given pretty much everything is at least mirrored if not developed on GH these days, a quick search for the API in question before removing it would most likely save _a lot_ of future headaches.