Couple of days ago I sent a patchlet for USB hub code to gregkh. The fix was about 10 lines big and it would not deserve mentioning but for its amusing work and social context.
It was known for a long time that the debouncing loop was broken from the conception, but nobody did anything to fix it. An incompetent programmer somewhere eventually came up with a patch, which does not fix the algorithm, but just short-circuits the loop instead, letting it to proceed. This fixed it for people who were frustrated by the original (broken) loop implementation. The patch began to float around, and one day SuSE began to ship it. Eventually, a gentleman from Khroatia came to the linux-usb-devel and wrote "This patch fixes my problem, SuSE ships it, so be so kind and include it in the mainstream kernel at last."
This was sooo wrong on so many levels, that I felt compelled to fix the darn thing. Also, I got some negative lessons, which may be obvious to some, but perhaps my elitism and snobism blinded me.
- Some time ago, if a person could formulate a patch with correct argument order for diff, I would assume he or she read the code, at least. It is NOT SO.
- (Corrolary: there is a swarm of garbage patches floating around).
- Lots of people mastered the skill of downloading and applying patches without a foggiest understanding of the code.
- Even big and respectable vendors do not read crap which they ship with their kernels.
Regarding the last point, I'm not saying that SuSE is particularly bad, or Red Hat is good in this respect. We always review patches we ship. This should be sufficient, right? Well, in case of the debounce loop, the garbage patch floating on the 'Net was so small, that it provided no context. It was pretty hard to tell from three lines up and down what it actually did. I caught it because I "own" the USB subsystem in Red Hat, so I am somewhat familiar with the code. We also have owners of other major subsystems, such as scsi (Doug), IDE (Alan & Arjan), filesystems (SCT & Al), processes/signals (DaveM/Alan), scheduler (Mingo), networking (DaveM). These people zealously guard their territories from infiltration of rogue code. But what if someone posts a patch for IEEE-1394 which fixes a problem on someone's box? Or same for ISDN? Thankfuly, we have a gatekeeper (Arjan), who is good at saying "no", but this is a personality. He may quit one day.
The answer is, of course, push everything through the community, and resist additional patches as much as possible. The pressure to include is strong, however. I remember a public outcry when we shipped 81 patch RPM for 5.2 or something like that. Despite Arjan's valiant efforts, we now ship about 300, and everyone appears resigned to it. But that's not the limit. United Linux pushes 800! Worse, Linus preaches vendor kernels in interviews. I dunno where this is going to end, I really don't.
Gloomy today, am I.
P.S. Do not download and apply crap patches without looking at the code they are touching.