飞道的博客

看Linus骂人,真解气

264人阅读  评论(0)

感受下Linus骂人的感觉吧, 这样你会觉得工作中遇到的那些不愉快就算个鸟事

背景

一个Linux主线的内核维护者提交了一份patch,并说明问题产生的原因是因为应用传的音频有问题。

Linus回复如下

你他娘的给老子闭嘴!这是一个内核bug好不好,你搞内核主线维护多长时间了?你还没学习过内核主线维护的规则?

如果一个用户程序导致了内核挂壁,这他娘的肯定是内核的问题,我们绝对不能因此责怪用户,这点很难去理解吗?

解释patch 巴拉巴拉……

Mauro 是一个人的名字,这次Linus发飙主要就是针对他的

你他丫的给我闭嘴,我再严肃的说一次,我再也不想看到这种白痴的行为发生在一个内核维护者身上。

解释让人合入bug patch,又说自己很忙巴拉巴拉……

WE DO NOT BREAK USERSPACE! 内核是不可能破坏应用空间的任何东西的。

我很严肃的说,理解这条规则很难吗?特别是,我们不应该用一个垃圾打断用户空间, I'm angry「我非常生气」,因为你整个邮件表现出如此可怕的错误,用一些垃圾代码来修补问题。你写的那个补丁就是一坨屎。增加了一个错误代码(ENOENT),脑子锈透了,这代码的漏洞是使用的 「?:」,这样如果想修改代码的判断逻辑就非常麻烦。

Fix your f*cking "compliance tool", because it is obviously broken. And fix your approach to kernel programming.

修好你这个该死的问题吧,它的错误太明显了,还有,修复你进入内核的代码吧。

原文如下:
https://lkml.org/lkml/2012/12/23/75


   
  1. On Sun, Dec 23, 2012 at 6: 08 AM, Mauro Carvalho Chehab
  2. <mchehab@redhat.com> wrote:
  3. >
  4. > Are you saying that pulseaudio is entering on some weird loop if the
  5. > returned value is not -EINVAL? That seems a bug at pulseaudio.
  6. Mauro, SHUT THE FUCK UP!
  7. It 's a bug alright - in the kernel. How long have you been a
  8. maintainer? And you *still* haven't learnt the first rule of kernel
  9. maintenance?
  10. If a change results in user programs breaking, it 's a bug in the
  11. kernel. We never EVER blame the user programs. How hard can this be to
  12. understand?
  13. To make matters worse, commit f0ed2ce840b3 is clearly total and utter
  14. CRAP even if it didn't break applications. ENOENT is not a valid error
  15. return from an ioctl. Never has been, never will be. ENOENT means "No
  16. such file and directory", and is for path operations. ioctl 's are done
  17. on files that have already been opened, there's no way in hell that
  18. ENOENT would ever be valid.
  19. > So, on a first glance, this doesn 't sound like a regression,
  20. > but, instead, it looks tha pulseaudio/tumbleweed has some serious
  21. > bugs and/or regressions.
  22. Shut up, Mauro. And I don't _ever_ want to hear that kind of obvious
  23. garbage and idiocy from a kernel maintainer again. Seriously.
  24. I 'd wait for Rafael's patch to go through you, but I have another
  25. error report in my mailbox of all KDE media applications being broken
  26. by v3 .8-rc1, and I bet it 's the same kernel bug. And you've shown
  27. yourself to not be competent in this issue, so I 'll apply it directly
  28. and immediately myself.
  29. WE DO NOT BREAK USERSPACE!
  30. Seriously. How hard is this rule to understand? We particularly don't
  31. break user space with TOTAL CRAP. I 'm angry, because your whole email
  32. was so _horribly_ wrong, and the patch that broke things was so
  33. obviously crap. The whole patch is incredibly broken shit. It adds an
  34. insane error code (ENOENT), and then because it's so insane, it adds a
  35. few places to fix it up ( "ret == -ENOENT ? -EINVAL : ret").
  36. The fact that you then try to make *excuses* for breaking user space,
  37. and blaming some external program that *used* to work, is just
  38. shameful. It 's not how we work.
  39. Fix your f*cking "compliance tool", because it is obviously broken.
  40. And fix your approach to kernel programming.
  41. Linus

Linux内核源码下,Linus大神骂人的注释

因为代码不规范骂人

Linus在很多地方说明了,不要随意使用换行,如果换行不正确,那么使用grep搜索关键字的时候显示会很不友好。

后话

代码规范是一个非常严肃的事情,我们在写代码的时候,不要只认为完成功能了就可以了。说一个比较基础的事情,我们在一个「.c」文件里面,有的人喜欢用空格,有的人喜欢用tab键,那我们在修改别人的代码的时候要怎么办呢?

这时候说到一个最基础的原则,遵守原来的规范,原来是用空格的,我们就用空格,原来用tab的,我们就使用tab,不要标新立异,不要觉得自己可以另类。

看了Linus 骂人,感觉自己在工作的时候遇到的那些事情都算屁大点事了,而且我遇到很多技术大牛,脾气都非常好,而很多脾气不好的,技术也是水的一逼。

再回头看看最近几年Linus大神的动态,感觉脾气已经没有那么大了,估计也是年轻气盛吧,谁不是想在年轻的时候轻狂一下,等经历了很多事情,再遇到一样的事情,觉得已经不是那么在乎了。

Linux的每个规范都使得Linux越来越强大,每个开发者认可这样的规范,并且这样的规范使得Linux越来越健壮,我们可能遇到很多其他的内核,不管是什么内核,都需要很多很多开发者共同努力,才可能达到一定的生态,Linus大神厉害的不是创造了Linux内核,而是他规范了很多约束调节和工具,比如GNU,比如开发了Git。

看这些大神的提交和邮件,不管是谁翻译,总是差点意思,我们要尝试去读英文翻译,去推敲里面的意思,品味他们骂人的韵味,领悟他们说话的含义,那样才更有意思。

以上是我的拙见,请轻拍~

推荐阅读:

专辑|Linux文章汇总

专辑|程序人生

嵌入式Linux

微信扫描二维码,关注我的公众号


转载:https://blog.csdn.net/weiqifa0/article/details/106631855
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场