Forgot your password?
typodupeerror
Bug Open Source Programming Linux

Linus Chews Up Kernel Maintainer For Introducing Userspace Bug 1051

Posted by timothy
from the otherwise-of-course-I'd-be-a-kernel-rockstar dept.
An anonymous reader points out just how thick a skin it takes to be a kernel developer sometimes, linking to a chain of emails on the Linux Kernel Mailing List in which Linus lets loose on a kernel developer for introducing a change that breaks userspace apps (in this case, PulseAudio). "Shut up, Mauro. And I don't _ever_ want to hear that kind of obvious garbage and idiocy from a kernel maintainer again. Seriously. I'd wait for Rafael's patch to go through you, but I have another error report in my mailbox of all KDE media applications being broken by v3.8-rc1, and I bet it's the same kernel bug. And you've shown yourself to not be competent in this issue, so I'll apply it directly and immediately myself. WE DO NOT BREAK USERSPACE! Seriously. How hard is this rule to understand? We particularly don't break user space with TOTAL CRAP. I'm angry, because your whole email was so _horribly_ wrong, and the patch that broke things was so obviously crap. ... The fact that you then try to make *excuses* for breaking user space, and blaming some external program that *used* to work, is just shameful. It's not how we work," writes Linus, and that's just the part we can print. Maybe it's a good thing, but there's certainly no handholding when it comes to changes to the heart of Linux.
This discussion has been archived. No new comments can be posted.

Linus Chews Up Kernel Maintainer For Introducing Userspace Bug

Comments Filter:
  • Still.... (Score:4, Funny)

    by jimpop (27817) * on Friday December 28, 2012 @10:00PM (#42416265) Homepage Journal

    ...a better love story than Twilight.

    • Re:Still.... (Score:5, Interesting)

      by girlintraining (1395911) on Friday December 28, 2012 @11:37PM (#42417051)

      ...a better love story than Twilight.

      Well, arguably what Linus is doing is a kind of tough love. He did something dumb and he's getting flogged for it. If his ego survives, he'll be a better programmer for it. That said, Linus is too much of a net celebrity to be laying someone out like that. It makes the news, like it did here, and then it makes Linux as an operating system -- and everything that runs on it and depends on it, look bad. It's like if Balmer dragged a programmer up on stage and proceeded to flog the crap out of him for ruining something in the windows kernel -- people would be all over what a horrible platform Windows is to develop for and what a horrible company Microsoft is. And Balmer could have been totally correct in everything he said about said hypothetical programmer.

      There's some things you just don't do on the public stage; And an e-mail list is public, yes.

      • Re:Still.... (Score:5, Insightful)

        by hairyfeet (841228) <bassbeast1968@@@gmail...com> on Saturday December 29, 2012 @12:26AM (#42417295) Journal

        Celeb or not I'd tell Torvalds to kiss my ass. I thought maybe that was at the end of a conversation...nope, the guy asks a simple question , one that would have taken Torvalds all of 30 seconds to explain like a rational human being, and instead he goes instantly to 11 on the douchebag scale.

        I don't give a flying fuck WHO it is, be it Torvalds or Ballmer or Cook or Ellison if someone acts like a total fucking douchebag they should be called out for it and I'm calling him out, Linus Torvalds you sir are a douchebag. you could have solved the whole fucking thing in under 30 seconds by simply explaining why "it must be thus" but instead just acted like a giant flaming prick, it was completely uncalled for, the other guy was acting complete civil and politely, therefor the asshole of the week award should be given to Torvalds for flying so completely off the handle when there was zero point in it.

        • Be fair (Score:5, Insightful)

          by melted (227442) on Saturday December 29, 2012 @12:56AM (#42417431) Homepage

          The guy deals with A LOT of bullshit on a daily basis, and this was a BS patch anyway. That would be the end of it if the dude didn't start coming up with excuses. If you know you're wrong, fucking say so and make things right.

        • Re:Still.... (Score:4, Insightful)

          by Myopic (18616) * on Saturday December 29, 2012 @01:15AM (#42417531)

          I think it would be quite appropriate for Microsoft to track down the people responsible for Windows, and force those people to apologize to the rest of us.

        • Re:Still.... (Score:5, Insightful)

          by Anonymous Coward on Saturday December 29, 2012 @02:00AM (#42417737)
          Just like you could have made your point without saying: douchebag, ass, giant flaming prick, and asshole.
        • Re:Still.... (Score:5, Insightful)

          by blind biker (1066130) on Saturday December 29, 2012 @02:03AM (#42417753) Journal

          I don't give a flying fuck WHO it is, be it Torvalds or Ballmer or Cook or Ellison if someone acts like a total fucking douchebag they should be called out for it and I'm calling him out, Linus Torvalds you sir are a douchebag. you could have solved the whole fucking thing in under 30 seconds by simply explaining why "it must be thus" but instead just acted like a giant flaming prick, it was completely uncalled for, the other guy was acting complete civil and politely, therefor the asshole of the week award should be given to Torvalds for flying so completely off the handle when there was zero point in it.

          Actually, the other guy, while being incompetent, was very manipulative, and it worked - with people like you. To be manipulative like that you have to have a lot of social intelligence, and that helps you to navigate situations in which your incompetence surfaces. Some people have little patience with such manipulations and fakery.

      • Re:Still.... (Score:5, Interesting)

        by Anonymous Coward on Saturday December 29, 2012 @01:43AM (#42417659)

        This little slice of linux kernel maintainer ethos indicates code quality and its twin sister, system stability, dominate the linux kernel culture as they should. Stability is the prime directive of an operating system. Its functionality must be rock solid. However this objective is enforced, be it code review, peer presure, humiliation, restricting code checkins - it has to happen. Sometimes the uber-egos of certain developers lead them to make brash decisions, and thus have to be dampened, with a club if necessary, for the good of the tribe. In the exotic world of clashing software Prima Donnas, a suit of armor is a necessity. The victim will survive.

  • Arsehole (Score:5, Insightful)

    by GrahamCox (741991) on Friday December 28, 2012 @10:00PM (#42416269) Homepage
    Winning friends and influencing people since 1983.

    Seriously, who'd put up with this crap? There are nicer ways to make ones way through life.
    • Re:Arsehole (Score:5, Insightful)

      by Anonymous Coward on Friday December 28, 2012 @10:05PM (#42416305)

      I wish my boss would show the same concern for the quality of our software, and scream at the programmers that break it every day. Unfortunately it doesn't happen, and other programmers end up fixing the broken code (and quietly grumbling) because otherwise they would not be able to do their jobs.

      Sometimes harsh words can send a message better than a general "please check your code before you commit".

      • Re:Arsehole (Score:5, Insightful)

        by jjohnson (62583) on Friday December 28, 2012 @10:30PM (#42416519) Homepage

        Of course, neither harsh words nor general "please check" encomiums are as good as calmly, straightforwardly stating "we do it this specific way, you did it that way instead, as a result we have this undesirable result. Do it again, correctly. In the future, check X, Y and Z to ensure that you don't repeat this mistake."

        Only in the socially retarded world of /. is this sort of behaviour lauded because the best behaviour that I described above seems too goddamned difficult to manage.

        • Re:Arsehole (Score:5, Insightful)

          by amiga3D (567632) on Friday December 28, 2012 @10:37PM (#42416585)

          While I agree somewhat with what you say I have to say that sometimes it is necessary to chew people out. I don't know what the situation is or the personality of the maintainer but people are different. What works with some doesn't with others. I have supervised people in a maintenance environment and while some just needed to be told what to do and let them run with it there were others that had to be kickstarted. Some people do actually benefit from a good ass chewing.

          • Re:Arsehole (Score:5, Interesting)

            by Zeussy (868062) on Friday December 28, 2012 @10:40PM (#42416601) Homepage
            Do we have the full story here? Has the maintainer done this repeatedly, or was this his first mistake? We are all human.
            • Re:Arsehole (Score:5, Funny)

              by Coeurderoy (717228) on Friday December 28, 2012 @10:54PM (#42416707)

              come on it's pulse audio related, of course people get nervous, angry and easily irritated ...

            • Re:Arsehole (Score:5, Interesting)

              by Man On Pink Corner (1089867) on Friday December 28, 2012 @11:10PM (#42416843)

              The rant wasn't about bad code, but a bad mindset. It was an apt response to Chehab's disregard for the integrity of existing Linux applications.

              It also wasn't really aimed at Mauro Chehab. Even the worst manager knows better than to discipline an individual employee in front of his/her peers, right? No, that flame was aimed at the entire mailing list. Linus obviously felt it necessary to drive the point home in a conspicuous way that wouldn't be forgotten or blown off.

              If there were still people at Microsoft with the technical and moral authority to send emails like that, the company's flatlined stock price graph would look very different.

        • Re:Arsehole (Score:5, Funny)

          by dcollins (135727) on Friday December 28, 2012 @10:45PM (#42416651) Homepage

          "Only in the socially retarded world of /. is this sort of behaviour lauded because the best behaviour that I described above seems too goddamned difficult to manage."

          Tut, tut, good sir. Next time please do try to deliver your observations in more civilized and diplomatic language.

        • Re:Arsehole (Score:4, Insightful)

          by whois (27479) on Saturday December 29, 2012 @03:01AM (#42418023) Homepage

          I self censor my emails all the time. You wouldn't believe how many long diatribes I've thrown away. How many heart felt impassioned speeches I've given up on as offensive or too harsh. I guess in some ways it makes the harsh emails I do send that much more potent. The point I'm trying to make is that it must take a special kind of person to stand up in front of more than 100,000 people and say "you're a moron, shut up!"

          He either realizes that this would cause a big fallout where his statement would be examined in detail by everyone on the mailing list + everyone on slashdot and a few other communities and just doesn't care; or he somehow hits the send button without ever realizing the consequences.

          I think it's the former, and despite his outburst he's still managed to steer the Linux community through 20 years of massive evolutionary changes in computing. It seems that even with armchair analysts saying he could get the job done without yelling, maybe should attempt the same thing, building a peaceful community of kernel hackers with no tyrant at the top and figure out a way to measure productivity, code quality and other metrics.

      • Re:Arsehole (Score:4, Insightful)

        by QuietLagoon (813062) on Friday December 28, 2012 @11:31PM (#42417013)

        I wish my boss would show the same concern for the quality of our software, and scream at the programmers that break it every day. Unfortunately it doesn't happen...

        Sure, it does happen. I have fired programmers who could not do their job. The firing was done in my office with the door closed. I did not post news of the firing on the internal company forums. I did not drag the body through the streets as an example.

        .
        Why do you rationalize poor management techniques as an excuse for poor management?

      • Re:Arsehole (Score:5, Insightful)

        by AuMatar (183847) on Saturday December 29, 2012 @12:30AM (#42417321)

        Bullshit. If someone is fucking up (especially repeatedly), the boss should talk to him. Not scream at him- talk in a professional manner. Or let him go, if the mistakes are bad enough. You do not disrespect your employees by screaming them- it solves nothing, causes workplace friction, lowers morale of both the one being screamed at, the one screaming, and their coworkers. Its counterproductive.

        If my boss came to my office and calmly told me I fucked up, I'd immediately jump on the problem and fix it. If my boss came in screaming at me, I'd tell him to get the fuck out, send an email to HR detailing his unacceptable behavior causing a hostile work environment and go home- telling him I'd return upon getting a sincere apology, and that I would expect full pay for every day in the interim. Oh, and my resumes would be on the net that evening. If he really pissed me off I'd go to his boss and tell him its me or him and I want a decision by the end of the day. There is no excuse for not behaving like an adult in the workplace.

    • by mbkennel (97636) on Friday December 28, 2012 @10:07PM (#42416325)

      It's just a kernel patch, nothing to be actually "angry" about. Why so emotional? And especially when it's somebody who is not an employee.

      Just say, "It is our firm policy that we do not break XXX, even when any given developer wishes they could. If you wish to continue contributing, you must follow the policy. Please apply the fix ASAP and acknowledge your understanding of these conditions."

      • by fredprado (2569351) on Friday December 28, 2012 @10:11PM (#42416361)
        Because the guy screwed up and tried to make excuses. At his position Linus does not have to put with childish behavior from his staff, he can choose who works with him.
        • by mbkennel (97636) on Friday December 28, 2012 @10:20PM (#42416445)

          "At his position Linus does not have to put with childish behavior from his staff"

          a) it wasn't his staff, it was somebody from Redhat. And even if it were....
          b) Linus was the only childish one getting all pantytied and emotional.

          Did you read the rest of the thread? And how the other people responded?

          It seems to be a complicated issue. The other people acknowledged the bug but showed it in context of some rather difficult hardware & driver issues across multiple areas.

    • Re:Arsehole (Score:5, Insightful)

      by fredprado (2569351) on Friday December 28, 2012 @10:08PM (#42416335)
      He isn't trying to make friends. He is trying to manage the efforts to implement a particularly complex piece of software, whilst hearing bullshit from one of his developers who made a very big mistake.

      Everybody makes mistakes, but the right posture when it was obviously your fault is to take the blame and learn from them, not to try and make excuses.
      • Re:Arsehole (Score:5, Insightful)

        by Hal_Porter (817932) on Friday December 28, 2012 @10:48PM (#42416665)

        How technical do I need to be before I can get away with telling people to "SHUT THE FUCK UP!". Script monkey? OS Kernel developer?

        Actually it has nothing to do with technical ability. You can tell people to shut the fuck up if you're not in a position to get fired when your boss finds out. I.e. you own the company or, like Linus, you are Benevolent Dictator For Life on some open source project.

        Of course - as Ulrich Drepper found out - even Benevolent Dictators For Life can look out of the window and see that the peasants are tearing down their statues, Ceausescu style. And most people reading this would get shitcanned from their sysadmin job a lot quicker than that for not jumping when their boss tells them.

        Really the tech world would be a lot more pleasant if people didn't conflate rudeness and technical competence. Most people seem to master the rudeness, neglect the technical competence and then wonder why they are undervalued.

        • Re:Arsehole (Score:5, Interesting)

          by bmo (77928) on Friday December 28, 2012 @11:02PM (#42416767)

          >Really the tech world would be a lot more pleasant if people didn't conflate rudeness and technical competence.

          The thing is that Linus is technically competent. He's in the 1% of technically competent people, so his "benevolent dictator for life" status is not changing any time soon. His ability to herd cats is manifested in his managing the Kernel for as long as he has. I'm sure if you approached Linus when he was 19 and told him that he was going to be managing one of the most important software projects on the planet for more than 20 years, he'd tell you that you were nuts.

          But here we are, and Linus is 43, and he's been doing this for quite a long time and Linus *doesn't* have a reputation for being a firebrand. And honestly, to even call Linus rude ignores the fact that when he's rude, it's actually news. Unlike Theo, who is just rude all the time, so it's never news.

          --
          BMO

      • Re:Arsehole (Score:5, Insightful)

        by TrekkieGod (627867) on Friday December 28, 2012 @10:55PM (#42416717) Homepage Journal

        He isn't trying to make friends. He is trying to manage the efforts to implement a particularly complex piece of software, whilst hearing bullshit from one of his developers who made a very big mistake. Everybody makes mistakes, but the right posture when it was obviously your fault is to take the blame and learn from them, not to try and make excuses.

        You can't fix unprofessionalism by being unprofessional. Linus's response is uncalled for, and if anyone I work for ever tells me to shut the fuck up, he can start looking for my replacement, and won't ever need to hear me speak up again.

        I agree with Linus's reasoning for why it's really a kernel bug, not a pulseaudio bug. The correct way of handling this would be to simply say, "you need to own up to this thing, because it's our policy that any kernel changes that breaks userspace applications is our problem. Fix this now." If for some reason this is a constant issue with the guy, than you remove him from that role as maintainer, but based on the lkml thread and the responses from Mauro, it seems Mauro had good reason to believe some things would remain broken after reverting the changes to the kernel, so he was just trying to understand the problem better. He behaved professionally, calmly explaining his position and agreeing with Linus about his mistake, on the face of having an adult throwing a tamper tantrum at him. Kudos to his patience, I don't share it. You simply could not pay me enough to work with someone who very publicly disrespected me in the way Linus did with him.

        • Re:Arsehole (Score:5, Interesting)

          by verbatim (18390) on Friday December 28, 2012 @11:22PM (#42416933) Homepage

          It's more insidious than that.

          If Linus coddles people, they get a false sense of approval. His brash, direct, and overtly emotional tone is intentional. It's to let the other party know exactly how he feels without accidentally leading them into a false sense of "oh, keep working on it and I'll approve it."

          Watch that video where he flips off Nvidia.

          He describes how being nice to people is the wrong approach, and makes things worse when the other side gets the wrong view, is rejected after months of effort in the wrong direction, and then Linus gets the blame for their suicide.

          If he was paying them, he could fire them. He doesn't have that luxury, so he has to be clear and direct.

          Don't like it? too bad. That's Linus, and he makes no excuses for how he behaves.

        • Re:Arsehole (Score:5, Insightful)

          by Kneo24 (688412) on Friday December 28, 2012 @11:44PM (#42417089) Homepage

          No level of "professionalism" will make most people understand how badly they screwed up when they screwed up badly. I have personally tried the professional route numerous times, only for the message to not get across. At that point your subordinates think you're a push over and that the problem wasn't that serious. Do what Linus did here when it's important and only when its important and you will accomplish two things. The first of course is getting your point across clearly. The second is that you don't tolerate any BS when someone has clearly screwed up.

  • by Lisias (447563) on Friday December 28, 2012 @10:01PM (#42416281) Homepage Journal

    This is somewhat related with this Linus' post [google.com] on G+?

  • by YrWrstNtmr (564987) on Friday December 28, 2012 @10:06PM (#42416315)
    Make a screwup this major, and this is what you get.
  • Not the bug... (Score:5, Informative)

    by Tau Neutrino (76206) on Friday December 28, 2012 @10:10PM (#42416357)
    It wasn't really the bug that set Linus off. At least not in my reading of the post. It was Mauro's cavalier attitude toward the bug. He tried to shrug it off as a problem with pulseaudio, when it clearly was a bug that he had introduced.

    I'm not a big fan of this style of management, but I can't fault any of the content of Linus' rant.
    • Re:Not the bug... (Score:5, Insightful)

      by krinderlin (1212738) on Friday December 28, 2012 @10:35PM (#42416561)

      That was my reading exactly. As a programmer, I've had to condition my responses to bug reports to move from, "What?! It's totally your fault!" to, "Let me investigate this on my end." It became fairly obvious from the get go that the patch made some changes that were overlooked in the patch. The patch commit message failed to give any reason or justification for the change (which was a 1 line change, possibly in a sea of other changes). Furthermore, the automated testing application that the patch submitter was using had a bug in it.

      It's likely the testing apparatus said, "OMG! THIS ERROR VALUE IS WRONG!" Then, the submitter corrected it to fit the bad test. Honestly, while Rafael signed off on it, it would appear the submitter set him up the bomb, so to speak. Who would make a change like that without further investigation and then submit it is a serious question. I would hope the patch submitter is placed under some additional scrutiny.

      All in all, Rafael took it in stride in his response. He also explained further, but appears to have capitulated that his initial reaction was wrong and that he should have fixed first, asked "Why are you using that, anyway?" later. Also, he should have never stated that, "So, on a first glance, this doesn't sound like a regression, but, instead, it looks that pulseaudio/tumbleweed has some serious bugs and/or regressions." It's quite obvious that changing not only what error code is returned but returning one that was literally impossible without telling anyone is a Bad Thing(TM).

      As for Linus's style of management, I don't know. I mean, Rafael was way, way, way out of line with that statement I quoted. He really failed to grasp the situation, even after it was clearly spelled out for him.

      All in all, I think he's learned his lesson and will be better for it. He seems to have taken it well enough, at least publicly. :-)

      • Re:Not the bug... (Score:4, Interesting)

        by Kjella (173770) on Friday December 28, 2012 @11:39PM (#42417067) Homepage

        I don't think you quite got it, as I understand it they have more error states internally than they do in the kernel API. The patch was designed to pass an internal error state that should have been replaced by the one in the kernel API before being returned but was accidentally pushed to userspace as well and the bug in the compliance tool meant they didn't notice. So far nothing majorly wrong, a poor patch and a testing tool with less than 100% coverage which caused a nasty bug to reach the first RC, a little sloppy but nothing that obviously should have been caught. The reason Linus gets so fired up is because it just doesn't matter what pulseaudio/tumbleweed is doing, there's zillions of applications out there who may be doing something crazy. If you broke one application you probably broke many more and it just doesn't matter, it's the kernel's fault.

        It's been a cornerstone of Linux for as long as I can remember, you can always upgrade your kernel and all your applications will continue to work, period. New APIs are of course added but old userspace APIs are forever. It just doesn't matter how crazy the userspace code is, you don't break it anyway and even if they fixed their crazy code it doesn't solve the problem which is that there'd be two kernels with different behavior So even if he was right, he's still wrong.

  • This is not news. (Score:4, Insightful)

    by JonniLuv (864539) on Friday December 28, 2012 @10:22PM (#42416453)
    Seriously, someone makes a coding mistake in a pre-release kernel, there's a heated e-mail chain about it, and now it's on /. Why?
  • by Qybix (103935) <qybix@shaw.ca> on Friday December 28, 2012 @10:29PM (#42416509) Homepage

    I am so tempted to kiss the guy! Linux can't have this type of _OBVIOUS_ audio sabotage at the kernel level if we expect game developers to ever make their products available on Linux. Linus NEEDS to reign this in, we just can't afford it. He is 110% right.

    Keep the helm firm, man! That's exactly what we need!

    Qybix

    • by VortexCortex (1117377) <VortexCortexNO@S ... t-retrograde.com> on Saturday December 29, 2012 @02:45AM (#42417969) Homepage

      As an application developer (and game developer by night), I concur. Test the patches before submitting them upstream. If you don't understand what the patches do, you don't approve them. Hell, that's the same requirement I have for all code in my projects. Even if it's a comment or whitespace change, you compile and (unit) test the module before committing it. It's a pretty brain dead rule of thumb: If you don't know what the fuck you're doing, don't do it! It's when you pretend to know more than you do that you get in trouble. The stupid thing is that there's no excuse for not knowing -- If all else fails, you ask the submitter who sent you the patch.

      Also, take Linus' wrath with a grain of salt. He enjoys being blunt and offending those that get offended. His opinion is that you can't actually offend someone, they have to take offense themselves. He get's most pissed when he knows he's right. He accepts people calling him stupid when they're right and he's wrong, like in this talk where he gives the finger to Nvida devs... WRT an early version of the Linux kernel: "We didn't have init. We don't need init, just a boot image and root console, that's how real men do it... Then someone came along and said, 'This is stupid, you need init', and they added init" -- I'm paraphrasing, that's pretty much how I remember it from the video. [youtube.com] Sorry, too lazy to re-watch and find the exact quote. Also contained therein is his position on being harsh...

      Also, Bill Gates, Steve Jobs, Steve Ballmer -- Come on, they're all notorious as being harsh At least Linus isn't parking in handy cap spaces, or throwing chairs like a real asshole.

  • by Anonymous Coward on Friday December 28, 2012 @10:37PM (#42416581)

    I wouldn't speak to anyone that way unless I never wanted to see them again. Shaming someone in public like this is a way to not only get them to quit, but to make a permanent enemy out of them.

    What this tells me is that Linus is better suited to be a cult leader than a manager of any kind.

  • Finally! (Score:5, Interesting)

    by toygeek (473120) on Friday December 28, 2012 @11:00PM (#42416755) Homepage Journal

    News for Nerds, Stuff that Matters! Thanks Slashdot! Its been a while...

  • Shit Happens (Score:5, Insightful)

    by MacGyver2210 (1053110) on Friday December 28, 2012 @11:10PM (#42416845)

    Sometimes shit happens. Sorry for that.

    Cheers,
    Mauro

    Wrong. Answer.

  • This is an inkblot (Score:4, Interesting)

    by Stirling Newberry (848268) on Friday December 28, 2012 @11:29PM (#42416999) Homepage Journal
    What someone says about it, says more about the commenter that the situation.
  • whiny mauro (Score:4, Informative)

    by Cyko_01 (1092499) on Saturday December 29, 2012 @12:03AM (#42417191) Homepage

    An anonymous reader points out just how thick a skin it takes to be a kernel developer sometimes...

    Mauro points out just how thick a skin it takes to be a kernel developer sometimes...there FTFY

  • by redback (15527) on Saturday December 29, 2012 @01:13AM (#42417519)

    Sometimes stupid people need to be told they are stupid, otherwise they wont stop being stupid.

  • by Animats (122034) on Saturday December 29, 2012 @03:29AM (#42418129) Homepage

    Take a look at the call for which ENOENT was returned. [linuxtv.org] The API spec says "EINVAL: The struct v4l2_queryctrl id is invalid. The struct v4l2_querymenu id is invalid or index is out of range (less than minimum or greater than maximum) or this particular menu item is not supported by the driver."

    This is from a generic driver mechanism for USB camera-like devices. Because such devices aren't as standard as they should be, there's an insane number of options and possible errors. The spec says to return EINVAL for both incorrect calls and calls for which the device does not support the requested item.

    The problem here is that the EINVAL error status doesn't distinguish between "program made bad call and is broken" and "we're iterating through the device functions to discover which ones are available, and this ID isn't meaningful on this device so skip it" EINVAL is supposed to mean "One or more of the ioctl parameters are invalid or out of the allowed range." A correctly made call should not return EINVAL.

    The alternatives are limited, though. This is related to a historical Linux design problem, which comes from a historical UNIX problem - system call errors are reported using one error code, chosen from a short list written in the 1970s. "ENOENT" isn't really appropriate. "ENOTTY" ("The ioctl is not supported by the driver"), might be appropriate, except that the usual message for that is "Not a typewriter".

    The API is a rather lame and excessively complex way to return what is merely a variable-length list of fixed-format structures. One would think that Linux would by now have a generic way to do that, since it comes up in other contexts.

    Here's an example of an application which seems to be crashing because the programmer did not understand the nonstandard semantics of EINVAL in this API. [stackoverflow.com]

You can bring any calculator you like to the midterm, as long as it doesn't dim the lights when you turn it on. -- Hepler, Systems Design 182

Working...